///Murphy, Aqeel, Castilla (2026)///

clear all
cd "User specified directory"
use "attritiondata", clear

cap which reghdfe
if _rc ssc install reghdfe
cap which balancetable
if _rc ssc install balancetable

//Table 1: Group Balance
global sprepblabuse sprepblabuse1_ sprepblabuse2_ sprepblabuse3_ sprepblabuse4_ sprepblabuse5_ sprepblabuse6_ sprepblabuse7_ sprepblabuse8_ sprepblabuse9_ sprepblabuse10_ sprepblabusetot sprepblabuseabavg

balancetable (mean if blgroup==2&blfemale==1&nonattrited==1) (diff treatment if blgroup!=3&blfemale==1&nonattrited==1) $sprepblabuse using "sprepblabusebalance.tex", varlabels replace ctitles("Control Mean" "Treat - Control") cov(blvillagenumber)

**# attrition analysis

keep if blfemale==1
local i=1
local j=1
global attrit nonattrited nonattrited22 nonattritedall county1 county2 county3

foreach vble of varlist $attrit{
eststo a`i': reg `vble' treatment if blgroup!=3, cluster(blvillagenumber)
estadd local fixed "No"
estadd local regressors "No"

scalar mean= round(r(mean), .01)
estadd scalar pcmean=mean
local indep_vars: colnames e(b)
local n_vars: colsof e(b)
local indep_hypotheses
foreach var of local indep_vars {
	local indep_hypotheses = "`indep_hypotheses' {`var'}"
}
boottest `indep_hypotheses', boot(wild) cluster(blvillagenumber) seed(99) nograph
matrix boot_pval  = J(1,`n_vars',.)
matrix boot_ci_lb = J(1,`n_vars',.)
matrix boot_ci_ub = J(1,`n_vars',.)
forval k = 1/`n_vars' { //Loop through predictors, aka matrix columns
	matrix boot_pval[1,`k'] = r(p_`k')
	matrix CI_temp = r(CI_`k')
	matrix boot_ci_lb[1,`k'] = CI_temp[1,1]
	matrix boot_ci_ub[1,`k'] = CI_temp[1,2]
}
foreach mat in "boot_pval" "boot_ci_lb" "boot_ci_ub" {
	matrix colnames `mat' = `indep_vars'
	estadd matrix `mat' = `mat'
}
local ++i
eststo a`i': reg `vble' treatment county2 county3 if blgroup!=3, cluster(blvillagenumber)
estadd local fixed "Yes"
estadd local regressors "No"
sum `vble', detail
scalar mean= round(r(mean), .001)
estadd scalar sampmean=mean
local indep_vars: colnames e(b)
local n_vars: colsof e(b)
local indep_hypotheses
foreach var of local indep_vars {
	local indep_hypotheses = "`indep_hypotheses' {`var'}"
}
boottest `indep_hypotheses', boot(wild) cluster(blvillagenumber) seed(99) nograph
matrix boot_pval  = J(1,`n_vars',.)
matrix boot_ci_lb = J(1,`n_vars',.)
matrix boot_ci_ub = J(1,`n_vars',.)
forval k = 1/`n_vars' { //Loop through predictors, aka matrix columns
	matrix boot_pval[1,`k'] = r(p_`k')
	matrix CI_temp = r(CI_`k')
	matrix boot_ci_lb[1,`k'] = CI_temp[1,1]
	matrix boot_ci_ub[1,`k'] = CI_temp[1,2]
}
foreach mat in "boot_pval" "boot_ci_lb" "boot_ci_ub" {
	matrix colnames `mat' = `indep_vars'
	estadd matrix `mat' = `mat'
}
local ++i


eststo a`i': reg `vble' treatment county2 county3 blage blalcoholnumber blagworkownfarmhours blnonagwageshours blhouseworkhours treatmentage treatmentalcnumber treatagworkownfarmhours  treatnonagwageshours  treathouseworkhours  if blgroup!=3, cluster(blvillagenumber)	

estadd local fixed "Yes"
estadd local regressors "Yes"
local indep_vars: colnames e(b)
local n_vars: colsof e(b)
local indep_hypotheses
foreach var of local indep_vars {
	local indep_hypotheses = "`indep_hypotheses' {`var'}"
}
boottest `indep_hypotheses', boot(wild) cluster(blvillagenumber) seed(99) nograph
matrix boot_pval  = J(1,`n_vars',.)
matrix boot_ci_lb = J(1,`n_vars',.)
matrix boot_ci_ub = J(1,`n_vars',.)
forval k = 1/`n_vars' { //Loop through predictors, aka matrix columns
	matrix boot_pval[1,`k'] = r(p_`k')
	matrix CI_temp = r(CI_`k')
	matrix boot_ci_lb[1,`k'] = CI_temp[1,1]
	matrix boot_ci_ub[1,`k'] = CI_temp[1,2]
}
foreach mat in "boot_pval" "boot_ci_lb" "boot_ci_ub" {
	matrix colnames `mat' = `indep_vars'
	estadd matrix `mat' = `mat'
}
local ++i
local ++j
}


label var blagworkownfarmhours "Hours worked own farm"
label var blnonagwageshours "Hours non-farm wage work"
label var blhouseworkhours "Hours engaged in housework"
label var blalcoholnumber "Alcohol drinks past week"
label var control "Spillover control (SC)"
label var treatment "Assigned to treatment (Treat)"

////Appendix Table A3: Attrition: OLS Estimates among Women

esttab a1 a2 a3 a4 a5 a6 a7 a8 a9 using "attritionwomen.tex", label replace obslast star(* 0.10 ** 0.05 *** 0.01) se nomtitles mgroups("\shortstack{Tracked between baseline\\and short-run survey}"  "\shortstack{Tracked between baseline\\and medium-run}" "\shortstack{Tracked across\\both rounds}", pattern(1 0 0 1 0 0 1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) substitute(\_ _) ///
scalars("fixed County dummies" "sampmean Mean of dep. variable") b(3) sfmt(3) cells(b(fmt(3) star) se(fmt(3) par)) nonotes nogaps noomitted order(treatment) collabels(none) drop(county2 county3) nolines prehead(\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}\begin{tabular}{l*{10}{c}}\midrule) posthead(\midrule) prefoot(\midrule) postfoot(\midrule \end{tabular} )

///Appendix Table 1: Correlations between baseline attitudes and IPV

matrix E=J(16,4,.)


global ipvvars findexfallipv2m findexfsexipv2m findexfphysipv2m findexfemoipv2m anyipv2m anysexipv2m anyphysipv2m anyemoipv2m findexfallipv6m findexfsexipv6m findexfphysipv6m findexfemoipv6m anyipv6m anysexipv6m anyphysipv6m anyemoipv6m

local i=1
foreach y of varlist $ipvvars{
areg `y' sprepblabuseabavg enumeratorfemale1, absorb(blcounty) robust
matrix R=r(table)
mat E[`i',1]=R[1,1]
mat E[`i',2]=R[2,1]
areg `y' sprepblabuse11_ enumeratorfemale1, absorb(blcounty) robust
matrix R=r(table)
mat E[`i',3]=R[1,1]
mat E[`i',4]=R[2,1]
local ++i
}

mat rownames E="Index all IPV past 2 mo" "Index sexual IPV past 2 mo" "Index physical IPV past 2 mo" "Index emotional IPV past 2 mo" "Any IPV past 2 mo" "Any sexual IPV past 2 mo" "Any physical IPV past 2 mo" "Any emotional IPV past 2 mo" "Index all IPV past 6 mo" "Index sexual IPV past 6 mo" "Index physical IPV past 6 mo" "Index emotional IPV past 6 mo" "Any IPV past 6 mo" "Any sexual IPV past 6 mo" "Any physical IPV past 6 mo" "Any emotional IPV past 6 mo"

frmttable using "ipvcorrelations1", statmat(E) sdec(3) hline(1100000000000000000) ctitle("" "\multicolumn{2}{c}{Husband: Above median regressive views}" "\multicolumn{2}{c}{Husband: Total regressive affirmations}" \ "Outcome Variable" "Coef" "SE" "Coef" "SE") tex frag replace

matrix F=J(16,4,.)


global ipvvars findexfallipv2m findexfsexipv2m findexfphysipv2m findexfemoipv2m anyipv2m anysexipv2m anyphysipv2m anyemoipv2m findexfallipv6m findexfsexipv6m findexfphysipv6m findexfemoipv6m anyipv6m anysexipv6m anyphysipv6m anyemoipv6m

local i=1
foreach y of varlist $ipvvars{
areg `y' blabuseabavg enumeratorfemale1, absorb(blcounty) robust
matrix R=r(table)
mat F[`i',1]=R[1,1]
mat F[`i',2]=R[2,1]
areg `y' blabuse11_ enumeratorfemale1, absorb(blcounty) robust
matrix R=r(table)
mat F[`i',3]=R[1,1]
mat F[`i',4]=R[2,1]
local ++i
}

mat rownames F="Index all IPV past 2 mo" "Index sexual IPV past 2 mo" "Index physical IPV past 2 mo" "Index emotional IPV past 2 mo" "Any IPV past 2 mo" "Any sexual IPV past 2 mo" "Any physical IPV past 2 mo" "Any emotional IPV past 2 mo" "Index all IPV past 6 mo" "Index sexual IPV past 6 mo" "Index physical IPV past 6 mo" "Index emotional IPV past 6 mo" "Any IPV past 6 mo" "Any sexual IPV past 6 mo" "Any physical IPV past 6 mo" "Any emotional IPV past 6 mo"

frmttable using "ipvcorrelations2", statmat(F) sdec(3) hline(1100000000000000001) ctitle("" "\multicolumn{2}{c}{Wife:\quad Above \; median \; regressive \; views}" "\multicolumn{2}{c}{Wife:\quad Total \; regressive \; affirmations}" \ "Outcome Variable" "Coef" "SE" "Coef" "SE") tex frag replace


clear all
macro drop _all

use "dyadicdatasetforestimation22", clear

drop if indvid==indvidmch //drop i=i dyads.

//set obs for questions not asked in 2021 to missing rather than zero.

rename domesticviolenceindividual22 domvioindv22
gen attendorgtogether22=attendnonreligiousorg22
replace attendorgtogether22=1 if attendreligiouswith22==1

foreach var of varlist knowperson22 domvioindv22 giselleprogramindividual22 receivedmoney22 givenmoney22 attendreligiouswith22 attendnonreligiousorg22 attendorgtogether22 speakdaily22 {
	gen `var'atrtu=`var'
	replace `var'atrt=1 if attrited22==1&asked==1
	gen `var'atrtb=`var'
	replace `var'atrtb=0 if attrited22==1&asked==1
}


global villagenumber villagenum2 villagenum3 villagenum4 villagenum5 villagenum6 villagenum7 villagenum8 villagenum9 villagenum10 villagenum11 villagenum12 villagenum13 villagenum14 villagenum15 villagenum16 villagenum17 villagenum18 villagenum19 villagenum20 villagenum21 villagenum22 villagenum23 villagenum24 villagenum25 villagenum26 villagenum27 villagenum28 villagenum29 villagenum30
global regressors  mathproblem readenglish readswahili multiplespouses hhsize blage yrseduc assetindx blalcoholnumber distvillagemediankm  
global regressorsmatch   mathproblemmch readenglishmch readswahilimch multiplespousesmch hhsizemch blagemch yrseducmch assetindxmch blalcoholnumbermch distvillagemediankmmch  
global ipvregressors blabuse1_ blabuse2_ blabuse3_ blabuse4_ blabuse5_ blabuse6_ blabuse7_ blabuse8_ blabuse9_ blabuse10_ blabusetot sprepblabuse1_ sprepblabuse2_ sprepblabuse3_ sprepblabuse4_ sprepblabuse5_ sprepblabuse6_ sprepblabuse7_ sprepblabuse8_ sprepblabuse9_ sprepblabuse10_ sprepblabusetot sprepblabuseabavg blabuseabavg
global ipvregressorsmatch blabuse1_mch blabuse2_mch blabuse3_mch blabuse4_mch blabuse5_mch blabuse6_mch blabuse7_mch blabuse8_mch blabuse9_mch blabuse10_mch blabusetotmch sprepblabuse1_mch sprepblabuse2_mch sprepblabuse3_mch sprepblabuse4_mch sprepblabuse5_mch sprepblabuse6_mch sprepblabuse7_mch sprepblabuse8_mch sprepblabuse9_mch sprepblabuse10_mch sprepblabusetotmch sprepblabuseabavgmch blabuseabavgmch


global enumerators enumeratorteam1_122 enumeratorteam2_122 enumeratorteam1_222 

sort indvid indvidmch

global sumvars1
global diffvars1
local num1 : word count $regressors
local num2 : word count $ipvregressors
local num3 : word count $relregressors


forvalues x=1/`num1'{
local z : word `x' of $regressors
local y : word `x' of $regressorsmatch
gen `z'sum=`z'+`y'
gen `z'diff=`z'-`y'
global sumvars1 $sumvars1 `z'sum
global diffvars1 $diffvars1 `z'diff 
}

forvalues x=1/`num2'{
local z : word `x' of $ipvregressors
local y : word `x' of $ipvregressorsmatch
gen `z'sum=`z'+`y'
gen `z'diff=`z'-`y'
}


drop distancekm2
gen distancekm2=distancekm^2



label var distancekm "$ ij $ home distance (km)"
label var distancekm2 "$ ij $ home distance (km sq)"
label var knowperson22 "Knows $ j $"
label var family "Immediate family member of $ j $"
label var familyext "Family relation of $ j $"
label var attendreligiouswith22 "Attend religious institution with $ j $"
label var attendnonreligiousorg22 "Attend non-religious organization with $ j $"
label var speakdaily22 "Speak daily with $ j $"
label var domvioindv22 "Spoken about domestic violence with $ j $"
label var giselleprogramindividual22 "Spoken about counseling program with $ j $"
label var receivedmoney22 "Received money from $ j $"
label var givenmoney22 "Gave money to $ j $"
label var sprepblabuseabavgsum "$ SP^+_{ij} $"
label var sprepblabuseabavgdiff "$ SP^-_{ij} $"
label var sprepblabuse6_sum "Right to beat wife for going out without permission: sum"
label var sprepblabuse6_diff "Right to beat wife for going out without permission: sum"
label var attendorgtogether22 "Attend any organization with $ j $"
recode blabuse1_diff blabuse2_diff blabuse3_diff blabuse4_diff blabuse5_diff blabuse6_diff blabuse7_diff blabuse8_diff blabuse9_diff  blabuse10_diff sprepblabuse1_diff sprepblabuse2_diff sprepblabuse3_diff sprepblabuse4_diff sprepblabuse5_diff sprepblabuse6_diff sprepblabuse7_diff sprepblabuse8_diff sprepblabuse9_diff sprepblabuseabavgdiff blabuseabavgdiff  (1=2) (0=1) (-1=0)

//////Table 2: Network Summary Statistics

global netsumstats knowperson22 familyext speakdaily22 attendorgtogether22 domvioindv22 giselleprogramindividual22 receivedmoney22 givenmoney22
mat mean_sd=J(8,2,.)
local i=1

local i=1
foreach var in $netsumstats{
sum `var' if purecontrol==0
 mat mean_sd[`i',1] = r(mean)
local ++i

} 

local i=1
foreach var in $netsumstats{
sum `var' if purecontrol==0&knowperson22==1
 mat mean_sd[`i',2] = r(mean)
local ++i
} 

mat rownames mean_sd = knowperson familyext speakdaily22 attendorgtogether22 domvioindv22 giselleprogramindividual22 receivedmoney22 givenmoney22 
frmttable using "networksummarystats22", statmat(mean_sd) sdec(3) varlabels ctitles("Dyadic Variable" , "Full sample of female dyads", "Conditional on knowing $ j $" ) addrows(N, "1,664", "1,563") hlines(11{0}11) tex frag replace



drop if purecontrol==1




matrix p_treattreat=J(6,1,.)
matrix p_treatcontrol=J(6,1,.)
matrix p_controltreat=J(6,1,.)
matrix p_distancekm=J(6,1,.)
matrix p_distancekm2=J(6,1,.)
matrix p_familyext=J(6,1,.)

global startvar domvioindv22 giselleprogramindividual22 receivedmoney22 givenmoney22 attendorgtogether22 speakdaily22 
local i=1
foreach var of varlist $startvar{
eststo a`i': reghdfe `var' i.treattreat i.treatcontrol i.controltreat distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch) 
mat p_treattreat[`i',1]=r(table)["pvalue","1.treattreat"]
mat p_treatcontrol[`i',1]=r(table)["pvalue","1.treatcontrol"]
mat p_controltreat[`i',1]=r(table)["pvalue","1.controltreat"]
mat p_distancekm[`i',1]=r(table)["pvalue","distancekm"]
mat p_distancekm2[`i',1]=r(table)["pvalue","distancekm2"]
mat p_familyext[`i',1]=r(table)["pvalue","familyext"]

local ++i
}

 

matrix p_ttanyipvblsum2_1=J(4,6,.) 
matrix p_tcanyipvblsum2_1=J(4,6,.) 
matrix p_ctanyipvblsum2_1=J(4,6,.) 
matrix p_ttanyipvblsum1_1=J(4,6,.) 
matrix p_tcanyipvblsum1_1=J(4,6,.) 
matrix p_ctanyipvblsum1_1=J(4,6,.) 

matrix p_anyipvblsum2_1=J(4,6,.) 
matrix p_anyipvblsum1_1=J(4,6,.) 
matrix p_ttsum_1=J(4,6,.) 
matrix p_tcsum_1=J(4,6,.) 
matrix p_ctsum_1=J(4,6,.) 




global ipvvar sprepblabuseabavgsum blabuseabavgsum  

global outcomevar domvioindv22 giselleprogramindividual22 receivedmoney22 givenmoney22 
local y=1
local r=1
foreach ipvvar of varlist $ipvvar{
local x=1

local z=1

foreach var of varlist $outcomevar{



eststo b`z'_`y': reghdfe `var' i.treattreat#i.`ipvvar' i.treatcontrol#i.`ipvvar'  i.controltreat#i.`ipvvar' i.treattreat i.treatcontrol i.controltreat i.`ipvvar' distancekm distancekm2 familyext, absorb($villagenumber $enumerators) cluster(indvid indvidmch)	
estadd local fes "Yes"
estadd local regressors "No"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++z


reghdfe `var' i.treattreat#i.`ipvvar' i.treatcontrol#i.`ipvvar'  i.controltreat#i.`ipvvar' i.treattreat i.treatcontrol i.controltreat i.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)	
margins, over(treattreat treatcontrol controltreat `ipvvar') post
matrix Ab`x'_`y'=J(4,4,.)
mat Ab`x'_`y'[2,1]=e(b)[1,1]
mat Ab`x'_`y'[2,2]=e(b)[1,4]
mat Ab`x'_`y'[2,3]=e(b)[1,7]
mat Ab`x'_`y'[2,4]=e(b)[1,10]
mat Ab`x'_`y'[3,1]=e(b)[1,2]
mat Ab`x'_`y'[3,2]=e(b)[1,5]
mat Ab`x'_`y'[3,3]=e(b)[1,8]
mat Ab`x'_`y'[3,4]=e(b)[1,11]
mat Ab`x'_`y'[4,1]=e(b)[1,3]
mat Ab`x'_`y'[4,2]=e(b)[1,6]
mat Ab`x'_`y'[4,3]=e(b)[1,9]
mat Ab`x'_`y'[4,4]=e(b)[1,12]


reghdfe `var' i.treattreat i.treatcontrol i.controltreat i.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)	
mat p_anyipvblsum2_1[`x',`r']=r(table)["pvalue","2.`ipvvar'"]
mat p_anyipvblsum1_1[`x',`r']=r(table)["pvalue","1.`ipvvar'"]
mat p_ttsum_1[`x',`r']=r(table)["pvalue","1.treattreat"]
mat p_tcsum_1[`x',`r']=r(table)["pvalue","1.treatcontrol"]
mat p_ctsum_1[`x',`r']=r(table)["pvalue","1.controltreat"]

local ++r

eststo b`z'_`y': reghdfe `var' i.treattreat#i.`ipvvar' i.treatcontrol#i.`ipvvar'  i.controltreat#i.`ipvvar' i.treattreat i.treatcontrol i.controltreat i.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)	
mat p_ttanyipvblsum2_1[`x',`r']=r(table)["pvalue","1.treattreat#2.`ipvvar'"]
mat p_tcanyipvblsum2_1[`x',`r']=r(table)["pvalue","1.treatcontrol#2.`ipvvar'"]
mat p_ctanyipvblsum2_1[`x',`r']=r(table)["pvalue","1.controltreat#2.`ipvvar'"]
mat p_ttanyipvblsum1_1[`x',`r']=r(table)["pvalue","1.treattreat#1.`ipvvar'"]
mat p_tcanyipvblsum1_1[`x',`r']=r(table)["pvalue","1.treatcontrol#1.`ipvvar'"]
mat p_ctanyipvblsum1_1[`x',`r']=r(table)["pvalue","1.controltreat#1.`ipvvar'"]

mat p_anyipvblsum2_1[`x',`r']=r(table)["pvalue","2.`ipvvar'"]
mat p_anyipvblsum1_1[`x',`r']=r(table)["pvalue","1.`ipvvar'"]
mat p_ttsum_1[`x',`r']=r(table)["pvalue","1.treattreat"]
mat p_tcsum_1[`x',`r']=r(table)["pvalue","1.treatcontrol"]
mat p_ctsum_1[`x',`r']=r(table)["pvalue","1.controltreat"]

estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++z
local ++x
local --r
}

mat AB1_`y'=Ab1_`y'\Ab2_`y'\Ab3_`y'\Ab4_`y'

local ++y
local ++r
local ++r

}





matrix p_ttanyipvbldiff2_1=J(4,6,.) 
matrix p_tcanyipvbldiff2_1=J(4,6,.) 
matrix p_ctanyipvbldiff2_1=J(4,6,.) 
matrix p_ttanyipvbldiff0_1=J(4,6,.) 
matrix p_tcanyipvbldiff0_1=J(4,6,.) 
matrix p_ctanyipvbldiff0_1=J(4,6,.) 


matrix p_anyipvbldiff2_1=J(4,6,.) 
matrix p_anyipvbldiff0_1=J(4,6,.) 
matrix p_ttdiff_1=J(4,6,.) 
matrix p_tcdiff_1=J(4,6,.) 
matrix p_ctdiff_1=J(4,6,.) 

global ipvvar sprepblabuseabavgdiff blabuseabavgdiff

global outcomevar domvioindv22 giselleprogramindividual22 receivedmoney22 givenmoney22 
local y=1
local r=1

foreach ipvvar of varlist $ipvvar{
local x=1

local z=1

foreach var of varlist $outcomevar{

	
eststo c`z'_`y': reghdfe `var' i.treattreat#ib1.`ipvvar' i.treatcontrol#ib1.`ipvvar' i.controltreat#ib1.`ipvvar' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "No"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean

local ++z

reghdfe `var' i.treattreat#ib1.`ipvvar' i.treatcontrol#ib1.`ipvvar' i.controltreat#ib1.`ipvvar' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
margins, over(treattreat treatcontrol controltreat `ipvvar') post
test 1.treattreat#0.treatcontrol#0.controltreat#2.`ipvvar'=0.treattreat#0.treatcontrol#0.controltreat#2.`ipvvar'


matrix Ac`x'_`y'=J(4,4,.)
mat Ac`x'_`y'[2,1]=e(b)[1,1]
mat Ac`x'_`y'[2,2]=e(b)[1,4]
mat Ac`x'_`y'[2,3]=e(b)[1,7]
mat Ac`x'_`y'[2,4]=e(b)[1,10]
mat Ac`x'_`y'[3,1]=e(b)[1,2]
mat Ac`x'_`y'[3,2]=e(b)[1,5]
mat Ac`x'_`y'[3,3]=e(b)[1,8]
mat Ac`x'_`y'[3,4]=e(b)[1,11]
mat Ac`x'_`y'[4,1]=e(b)[1,3]
mat Ac`x'_`y'[4,2]=e(b)[1,6]
mat Ac`x'_`y'[4,3]=e(b)[1,9]
mat Ac`x'_`y'[4,4]=e(b)[1,12]

reghdfe `var' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
mat p_anyipvbldiff2_1[`x',`r']=r(table)["pvalue","2.`ipvvar'"]
mat p_anyipvbldiff0_1[`x',`r']=r(table)["pvalue","0.`ipvvar'"]
mat p_ttdiff_1[`x',`r']=r(table)["pvalue","1.treattreat"]
mat p_tcdiff_1[`x',`r']=r(table)["pvalue","1.treatcontrol"]
mat p_ctdiff_1[`x',`r']=r(table)["pvalue","1.controltreat"]

local ++r
eststo c`z'_`y': reghdfe `var' i.treattreat#ib1.`ipvvar' i.treatcontrol#ib1.`ipvvar' i.controltreat#ib1.`ipvvar' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
mat p_ttanyipvbldiff2_1[`x',`r']=r(table)["pvalue","1.treattreat#2.`ipvvar'"]
mat p_tcanyipvbldiff2_1[`x',`r']=r(table)["pvalue","1.treatcontrol#2.`ipvvar'"]
mat p_ctanyipvbldiff2_1[`x',`r']=r(table)["pvalue","1.controltreat#2.`ipvvar'"]
mat p_ttanyipvbldiff0_1[`x',`r']=r(table)["pvalue","1.treattreat#0.`ipvvar'"]
mat p_tcanyipvbldiff0_1[`x',`r']=r(table)["pvalue","1.treatcontrol#0.`ipvvar'"]
mat p_ctanyipvbldiff0_1[`x',`r']=r(table)["pvalue","1.controltreat#0.`ipvvar'"]

mat p_anyipvbldiff2_1[`x',`r']=r(table)["pvalue","2.`ipvvar'"]
mat p_anyipvbldiff0_1[`x',`r']=r(table)["pvalue","0.`ipvvar'"]
mat p_ttdiff_1[`x',`r']=r(table)["pvalue","1.treattreat"]
mat p_tcdiff_1[`x',`r']=r(table)["pvalue","1.treatcontrol"]
mat p_ctdiff_1[`x',`r']=r(table)["pvalue","1.controltreat"]

estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean

local ++z
local ++x
local --r
}

 
mat AC1_`y'=Ac1_`y'\Ac2_`y'\Ac3_`y'\Ac4_`y'

 
local ++y
local ++r
local ++r
}
 



 

matrix p_ttanyipvblsum2_2=J(2,6,.) 
matrix p_tcanyipvblsum2_2=J(2,6,.) 
matrix p_ctanyipvblsum2_2=J(2,6,.) 
matrix p_ttanyipvblsum1_2=J(2,6,.) 
matrix p_tcanyipvblsum1_2=J(2,6,.) 
matrix p_ctanyipvblsum1_2=J(2,6,.) 
matrix p_anyipvblsum2_2=J(2,6,.) 
matrix p_anyipvblsum1_2=J(2,6,.) 
matrix p_ttsum_2=J(2,6,.) 
matrix p_tcsum_2=J(2,6,.) 
matrix p_ctsum_2=J(2,6,.) 

global ipvvar sprepblabuseabavgsum blabuseabavgsum

global outcomevar attendorgtogether22 speakdaily22
local y=1
local r=1
foreach ipvvar of varlist $ipvvar{
local x=1

local z=1

foreach var of varlist $outcomevar{


eststo g`z'_`y': reghdfe `var' i.treattreat#i.`ipvvar' i.treatcontrol#i.`ipvvar'  i.controltreat#i.`ipvvar' i.treattreat i.treatcontrol i.controltreat i.`ipvvar' distancekm distancekm2 familyext, absorb($villagenumber $enumerators) cluster(indvid indvidmch)	
estadd local fes "Yes"
estadd local regressors "No"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++z


reghdfe `var' i.treattreat#i.`ipvvar' i.treatcontrol#i.`ipvvar'  i.controltreat#i.`ipvvar' i.treattreat i.treatcontrol i.controltreat i.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)	
margins, over(treattreat treatcontrol controltreat `ipvvar') post
matrix Ag`x'_`y'=J(4,4,.)
mat Ag`x'_`y'[2,1]=e(b)[1,1]
mat Ag`x'_`y'[2,2]=e(b)[1,4]
mat Ag`x'_`y'[2,3]=e(b)[1,7]
mat Ag`x'_`y'[2,4]=e(b)[1,10]
mat Ag`x'_`y'[3,1]=e(b)[1,2]
mat Ag`x'_`y'[3,2]=e(b)[1,5]
mat Ag`x'_`y'[3,3]=e(b)[1,8]
mat Ag`x'_`y'[3,4]=e(b)[1,11]
mat Ag`x'_`y'[4,1]=e(b)[1,3]
mat Ag`x'_`y'[4,2]=e(b)[1,6]
mat Ag`x'_`y'[4,3]=e(b)[1,9]
mat Ag`x'_`y'[4,4]=e(b)[1,12]


reghdfe `var' i.treattreat i.treatcontrol i.controltreat i.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)	
mat p_anyipvblsum2_2[`x',`r']=r(table)["pvalue","2.`ipvvar'"]
mat p_anyipvblsum1_2[`x',`r']=r(table)["pvalue","1.`ipvvar'"]
mat p_ttsum_2[`x',`r']=r(table)["pvalue","1.treattreat"]
mat p_tcsum_2[`x',`r']=r(table)["pvalue","1.treatcontrol"]
mat p_ctsum_2[`x',`r']=r(table)["pvalue","1.controltreat"]

local ++r

eststo g`z'_`y': reghdfe `var' i.treattreat#i.`ipvvar' i.treatcontrol#i.`ipvvar'  i.controltreat#i.`ipvvar' i.treattreat i.treatcontrol i.controltreat i.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)	
mat p_ttanyipvblsum2_2[`x',`r']=r(table)["pvalue","1.treattreat#2.`ipvvar'"]
mat p_tcanyipvblsum2_2[`x',`r']=r(table)["pvalue","1.treatcontrol#2.`ipvvar'"]
mat p_ctanyipvblsum2_2[`x',`r']=r(table)["pvalue","1.controltreat#2.`ipvvar'"]
mat p_ttanyipvblsum1_2[`x',`r']=r(table)["pvalue","1.treattreat#1.`ipvvar'"]
mat p_tcanyipvblsum1_2[`x',`r']=r(table)["pvalue","1.treatcontrol#1.`ipvvar'"]
mat p_ctanyipvblsum1_2[`x',`r']=r(table)["pvalue","1.controltreat#1.`ipvvar'"]

mat p_anyipvblsum2_2[`x',`r']=r(table)["pvalue","2.`ipvvar'"]
mat p_anyipvblsum1_2[`x',`r']=r(table)["pvalue","1.`ipvvar'"]
mat p_ttsum_2[`x',`r']=r(table)["pvalue","1.treattreat"]
mat p_tcsum_2[`x',`r']=r(table)["pvalue","1.treatcontrol"]
mat p_ctsum_2[`x',`r']=r(table)["pvalue","1.controltreat"]

estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++z
local ++x
local --r
}


mat AG1_`y'=Ag1_`y'\Ag2_`y'

local ++y
local ++r
local ++r

}




matrix p_ttanyipvbldiff2_2=J(2,6,.) 
matrix p_tcanyipvbldiff2_2=J(2,6,.) 
matrix p_ctanyipvbldiff2_2=J(2,6,.) 
matrix p_ttanyipvbldiff0_2=J(2,6,.) 
matrix p_tcanyipvbldiff0_2=J(2,6,.) 
matrix p_ctanyipvbldiff0_2=J(2,6,.) 


matrix p_anyipvbldiff2_2=J(2,6,.) 
matrix p_anyipvbldiff0_2=J(2,6,.) 
matrix p_ttdiff_2=J(2,6,.) 
matrix p_tcdiff_2=J(2,6,.) 
matrix p_ctdiff_2=J(2,6,.) 

global ipvvar sprepblabuseabavgdiff blabuseabavgdiff

global outcomevar attendorgtogether22 speakdaily22 
local y=1
local r=1

foreach ipvvar of varlist $ipvvar{
local x=1

local z=1

foreach var of varlist $outcomevar{

eststo f`z'_`y': reghdfe `var' i.treattreat#ib1.`ipvvar' i.treatcontrol#ib1.`ipvvar' i.controltreat#ib1.`ipvvar' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "No"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++z

reghdfe `var' i.treattreat#ib1.`ipvvar' i.treatcontrol#ib1.`ipvvar' i.controltreat#ib1.`ipvvar' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
margins, over(treattreat treatcontrol controltreat `ipvvar') post
matrix Af`x'_`y'=J(4,4,.)
mat Af`x'_`y'[2,1]=e(b)[1,1]
mat Af`x'_`y'[2,2]=e(b)[1,4]
mat Af`x'_`y'[2,3]=e(b)[1,7]
mat Af`x'_`y'[2,4]=e(b)[1,10]
mat Af`x'_`y'[3,1]=e(b)[1,2]
mat Af`x'_`y'[3,2]=e(b)[1,5]
mat Af`x'_`y'[3,3]=e(b)[1,8]
mat Af`x'_`y'[3,4]=e(b)[1,11]
mat Af`x'_`y'[4,1]=e(b)[1,3]
mat Af`x'_`y'[4,2]=e(b)[1,6]
mat Af`x'_`y'[4,3]=e(b)[1,9]
mat Af`x'_`y'[4,4]=e(b)[1,12]

reghdfe `var' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
mat p_anyipvbldiff2_2[`x',`r']=r(table)["pvalue","2.`ipvvar'"]
mat p_anyipvbldiff0_2[`x',`r']=r(table)["pvalue","0.`ipvvar'"]
mat p_ttdiff_2[`x',`r']=r(table)["pvalue","1.treattreat"]
mat p_tcdiff_2[`x',`r']=r(table)["pvalue","1.treatcontrol"]
mat p_ctdiff_2[`x',`r']=r(table)["pvalue","1.controltreat"]

local ++r
eststo f`z'_`y': reghdfe `var' i.treattreat#ib1.`ipvvar' i.treatcontrol#ib1.`ipvvar' i.controltreat#ib1.`ipvvar' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
mat p_ttanyipvbldiff2_2[`x',`r']=r(table)["pvalue","1.treattreat#2.`ipvvar'"]
mat p_tcanyipvbldiff2_2[`x',`r']=r(table)["pvalue","1.treatcontrol#2.`ipvvar'"]
mat p_ctanyipvbldiff2_2[`x',`r']=r(table)["pvalue","1.controltreat#2.`ipvvar'"]
mat p_ttanyipvbldiff0_2[`x',`r']=r(table)["pvalue","1.treattreat#0.`ipvvar'"]
mat p_tcanyipvbldiff0_2[`x',`r']=r(table)["pvalue","1.treatcontrol#0.`ipvvar'"]
mat p_ctanyipvbldiff0_2[`x',`r']=r(table)["pvalue","1.controltreat#0.`ipvvar'"]

mat p_anyipvbldiff2_2[`x',`r']=r(table)["pvalue","2.`ipvvar'"]
mat p_anyipvbldiff0_2[`x',`r']=r(table)["pvalue","0.`ipvvar'"]
mat p_ttdiff_2[`x',`r']=r(table)["pvalue","1.treattreat"]
mat p_tcdiff_2[`x',`r']=r(table)["pvalue","1.treatcontrol"]
mat p_ctdiff_2[`x',`r']=r(table)["pvalue","1.controltreat"]

estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean

local ++z
local ++x
local --r
}

 
 mat AF1_`y'=Af1_`y'\Af2_`y'

 
local ++y
local ++r
local ++r
}

 


coefplot  (b2_1, mcolor(black) ciopts(lcolor(black) ) msize(small) label("Disc. domestic violence")) (b4_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(T) label("Disc. counseling program")) (b6_1, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(small) label("Received money")) (b8_1, msymbol(S) mcolor(black) ciopts(lcolor(black) ) msize(small) label("Gave money")) (g2_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(Oh) label("Attend any org")) (g4_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(Th) label("Speak daily")), label keep(1.treattreat#1.sprepblabuseabavgsum 1.treatcontrol#1.sprepblabuseabavgsum 1.controltreat#1.sprepblabuseabavgsum)  rename(1.treattreat#1.sprepblabuseabavgsum="Treat-Treat X Sum Sp. Beat Abv Avg=1" 1.treatcontrol#1.sprepblabuseabavgsum="Treat-Control X Sum Sp. Beat Abv Avg=1"  1.controltreat#1.sprepblabuseabavgsum="Control-Treat X Sum Sp. Beat Abv Avg=1") xline(0, lstyle(color(black) pattern(dash))) legend(size(small))  ysize(3) xsize(3) scale(.65) ylabel(,labsize(small))
graph export sprepblabuseabavgsum1.jpg, replace  width(4000) height(4800) quality(75)


coefplot  (b2_1, mcolor(black) ciopts(lcolor(black) ) msize(small) label("Disc. domestic violence")) (b4_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(T) label("Disc. counseling program")) (b6_1, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(small) label("Received money")) (b8_1, msymbol(S) mcolor(black) ciopts(lcolor(black) ) msize(small) label("Gave money")) (g2_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(Oh) label("Attend any org")) (g4_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(Th) label("Speak daily")), label keep(1.treattreat#2.sprepblabuseabavgsum 1.treatcontrol#2.sprepblabuseabavgsum 1.controltreat#2.sprepblabuseabavgsum)  rename(1.treattreat#2.sprepblabuseabavgsum="Treat-Treat X Sum Sp. Beat Abv Avg=2" 1.treatcontrol#2.sprepblabuseabavgsum="Treat-Control X Sum Sp. Beat Abv Avg=2"  1.controltreat#2.sprepblabuseabavgsum="Control-Treat X Sum Sp. Beat Abv Avg=2") xline(0, lstyle(color(black) pattern(dash)))  ysize(3) xsize(3) scale(.65) legend(size(small))  ylabel(,labsize(small))
graph export sprepblabuseabavgsum2.jpg, replace  width(4000) height(4800) quality(75)



coefplot  (b2_2, mcolor(black) ciopts(lcolor(black) ) msize(small) label("Disc. domestic violence")) (b4_2, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(T) label("Disc. counseling program")) (b6_2, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(small) label("Received money")) (b8_2, msymbol(S) mcolor(black) ciopts(lcolor(black) ) msize(small) label("Gave money")) (g2_2, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(Oh) label("Attend any org")) (g4_2, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(Th) label("Speak daily")), label keep(1.treattreat#1.blabuseabavgsum 1.treatcontrol#1.blabuseabavgsum 1.controltreat#1.blabuseabavgsum)  rename(1.treattreat#1.blabuseabavgsum="Treat-Treat X Sum Beat Abv Avg=1" 1.treatcontrol#1.blabuseabavgsum="Treat-Control X Sum Beat Abv Avg=1"  1.controltreat#1.blabuseabavgsum="Control-Treat X Sum Beat Abv Avg=1") xline(0, lstyle(color(black) pattern(dash))) legend(size(small))  ysize(3) xsize(3) scale(.65) ylabel(,labsize(small))
graph export blabuseabavgsum1.jpg, replace  width(4000) height(4800) quality(75)


coefplot  (b2_2, mcolor(black) ciopts(lcolor(black) ) msize(small) label("Disc. domestic violence")) (b4_2, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(T) label("Disc. counseling program")) (b6_2, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(small) label("Received money")) (b8_2, msymbol(S) mcolor(black) ciopts(lcolor(black) ) msize(small) label("Gave money")) (g2_2, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(Oh) label("Attend any org")) (g4_2, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(Th) label("Speak daily")), label keep(1.treattreat#2.blabuseabavgsum 1.treatcontrol#2.blabuseabavgsum 1.controltreat#2.blabuseabavgsum)  rename(1.treattreat#2.blabuseabavgsum="Treat-Treat X Sum Beat Abv Avg=2" 1.treatcontrol#2.blabuseabavgsum="Treat-Control X Sum Beat Abv Avg=2"  1.controltreat#2.blabuseabavgsum="Control-Treat X Sum Beat Abv Avg=2") xline(0, lstyle(color(black) pattern(dash)))  ysize(3) xsize(3) scale(.65) legend(size(small))  ylabel(,labsize(small))
graph export blabuseabavgsum2.jpg, replace  width(4000) height(4800) quality(75)







coefplot (c2_1, mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Disc. domestic violence")) (c4_1, mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(T) label("Disc. counseling program")) (c6_1, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Received money")) (c8_1, msymbol(S) mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Gave money")) (f2_1 , mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(Oh) label("Attend any org")) (f4_1 , mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(Th) label("Speak daily")), label keep(1.treattreat#0.sprepblabuseabavgdiff 1.treatcontrol#0.sprepblabuseabavgdiff  1.controltreat#0.sprepblabuseabavgdiff)  rename(1.treattreat#0.sprepblabuseabavgdiff="Treat-Treat X Diff Sp. Beat Abv Avg=0" 1.treatcontrol#0.sprepblabuseabavgdiff="Treat-Control X Diff Sp. Beat Abv Avg=0" 1.controltreat#0.sprepblabuseabavgdiff="Control-Treat X Diff Sp. Beat Abv Avg=0") xline(0, lstyle(color(black) pattern(dash))) ysize(3) xsize(3) scale(.65) legend(size(small))  ylabel(,labsize(small))
graph export sprepblabuseabavgdiff1.jpg, replace  width(4000) height(4800) quality(75)

coefplot (c2_1, mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Disc. domestic violence")) (c4_1, mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(T) label("Disc. counseling program")) (c6_1, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Received money")) (c8_1, msymbol(S) mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Gave money")) (f2_1 , mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(Oh) label("Attend any org")) (f4_1 , mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(Th) label("Speak daily")), label keep(1.treattreat#2.sprepblabuseabavgdiff 1.treatcontrol#2.sprepblabuseabavgdiff  1.controltreat#2.sprepblabuseabavgdiff)  rename(1.treattreat#2.sprepblabuseabavgdiff="Treat-Treat X Diff Sp. Beat Abv Avg=2" 1.treatcontrol#2.sprepblabuseabavgdiff="Treat-Control X Diff Sp. Beat Abv Avg=2" 1.controltreat#2.sprepblabuseabavgdiff="Control-Treat X Diff Sp. Beat Abv Avg=2") xline(0, lstyle(color(black) pattern(dash))) ysize(3) xsize(3) scale(.65) legend(size(small))  ylabel(,labsize(small))
graph export sprepblabuseabavgdiff2.jpg, replace  width(4000) height(4800) quality(75)



coefplot (c2_2, mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Disc. domestic violence")) (c4_2, mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(T) label("Disc. counseling program")) (c6_2, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Received money")) (c8_2, msymbol(S) mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Gave money")) (f2_2 , mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(Oh) label("Attend any org")) (f4_2 , mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(Th) label("Speak daily")), label keep(1.treattreat#0.blabuseabavgdiff 1.treatcontrol#0.blabuseabavgdiff  1.controltreat#0.blabuseabavgdiff)  rename(1.treattreat#0.blabuseabavgdiff="Treat-Treat X Diff Beat Abv Avg=0" 1.treatcontrol#0.blabuseabavgdiff="Treat-Control X Diff Beat Abv Avg=0" 1.controltreat#0.blabuseabavgdiff="Control-Treat X Diff Beat Abv Avg=0") xline(0, lstyle(color(black) pattern(dash))) ysize(3) xsize(3) scale(.65) legend(size(small))  ylabel(,labsize(small))
graph export blabuseabavgdiff1.jpg, replace  width(4000) height(4800) quality(75)


coefplot (c2_2, mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Disc. domestic violence")) (c4_2, mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(T) label("Disc. counseling program")) (c6_2, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Received money")) (c8_2, msymbol(S) mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Gave money")) (f2_2 , mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(Oh) label("Attend any org")) (f4_2 , mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(Th) label("Speak daily")), label keep(1.treattreat#2.blabuseabavgdiff 1.treatcontrol#2.blabuseabavgdiff  1.controltreat#2.blabuseabavgdiff)  rename(1.treattreat#2.blabuseabavgdiff="Treat-Treat X Diff Beat Abv Avg=2" 1.treatcontrol#2.blabuseabavgdiff="Treat-Control X Diff Beat Abv Avg=2" 1.controltreat#2.blabuseabavgdiff="Control-Treat X Diff Beat Abv Avg=2") xline(0, lstyle(color(black) pattern(dash))) ysize(3) xsize(3) scale(.65) legend(size(small))  ylabel(,labsize(small))
graph export blabuseabavgdiff2.jpg, replace  width(4000) height(4800) quality(75)



mat p_ttanyipvblsum2=p_ttanyipvblsum2_1\p_ttanyipvblsum2_2
mat p_tcanyipvblsum2=p_tcanyipvblsum2_1\p_tcanyipvblsum2_2
mat p_ctanyipvblsum2=p_ctanyipvblsum2_1\p_ctanyipvblsum2_2
mat p_ttsprepblabuseabavgsum2=p_ttanyipvblsum2[1...,2]
mat p_ttblabuseabavgsum2=p_ttanyipvblsum2[1...,4]

mat p_tcsprepblabuseabavgsum2=p_tcanyipvblsum2[1...,2]
mat p_tcblabuseabavgsum2=p_tcanyipvblsum2[1...,4]


mat p_ctsprepblabuseabavgsum2=p_ctanyipvblsum2[1...,2]
mat p_ctblabuseabavgsum2=p_ctanyipvblsum2[1...,4]

mat p_ttanyipvblsum1=p_ttanyipvblsum1_1\p_ttanyipvblsum1_2
mat p_tcanyipvblsum1=p_tcanyipvblsum1_1\p_tcanyipvblsum1_2
mat p_ctanyipvblsum1=p_ctanyipvblsum1_1\p_ctanyipvblsum1_2


mat p_ttsprepblabuseabavgsum1=p_ttanyipvblsum1[1...,2]
mat p_ttblabuseabavgsum1=p_ttanyipvblsum1[1...,4]

mat p_tcsprepblabuseabavgsum1=p_tcanyipvblsum1[1...,2]
mat p_tcblabuseabavgsum1=p_tcanyipvblsum1[1...,4]

mat p_ctsprepblabuseabavgsum1=p_ctanyipvblsum1[1...,2]
mat p_ctblabuseabavgsum1=p_ctanyipvblsum1[1...,4]

mat p_ttanyipvbldiff2=p_ttanyipvbldiff2_1\p_ttanyipvbldiff2_2
mat p_tcanyipvbldiff2=p_tcanyipvbldiff2_1\p_tcanyipvbldiff2_2
mat p_ctanyipvbldiff2=p_ctanyipvbldiff2_1\p_ctanyipvbldiff2_2

mat p_ttsprepblabuseabavgdiff2=p_ttanyipvbldiff2[1...,2]
mat p_ttblabuseabavgdiff2=p_ttanyipvbldiff2[1...,4]

mat p_tcsprepblabuseabavgdiff2=p_tcanyipvbldiff2[1...,2]
mat p_tcblabuseabavgdiff2=p_tcanyipvbldiff2[1...,4]

mat p_ctsprepblabuseabavgdiff2=p_ctanyipvbldiff2[1...,2]
mat p_ctblabuseabavgdiff2=p_ctanyipvbldiff2[1...,4]

mat p_ttanyipvbldiff0=p_ttanyipvbldiff0_1\p_ttanyipvbldiff0_2
mat p_tcanyipvbldiff0=p_tcanyipvbldiff0_1\p_tcanyipvbldiff0_2
mat p_ctanyipvbldiff0=p_ctanyipvbldiff0_1\p_ctanyipvbldiff0_2


mat p_ttsprepblabuseabavgdiff0=p_ttanyipvbldiff0[1...,2]
mat p_ttblabuseabavgdiff0=p_ttanyipvbldiff0[1...,4]

mat p_tcsprepblabuseabavgdiff0=p_tcanyipvbldiff0[1...,2]
mat p_tcblabuseabavgdiff0=p_tcanyipvbldiff0[1...,4]

mat p_ctsprepblabuseabavgdiff0=p_ctanyipvbldiff0[1...,2]
mat p_ctblabuseabavgdiff0=p_ctanyipvbldiff0[1...,4]


mat p_anyipvblsum2=p_anyipvblsum2_1\p_anyipvblsum2_2
mat p_sprepblabuseabavgsum2_1=p_anyipvblsum2[1...,1]
mat p_sprepblabuseabavgsum2_2=p_anyipvblsum2[1...,2]
mat p_sprepblabuseabavgsum2=p_sprepblabuseabavgsum2_1\p_sprepblabuseabavgsum2_2
mat p_blabuseabavgsum2_1=p_anyipvblsum2[1...,3]
mat p_blabuseabavgsum2_2=p_anyipvblsum2[1...,4]
mat p_blabuseabavgsum2=p_blabuseabavgsum2_1\p_blabuseabavgsum2_2



mat p_anyipvblsum1=p_anyipvblsum1_1\p_anyipvblsum1_2
mat p_sprepblabuseabavgsum1_1=p_anyipvblsum1[1...,1]
mat p_sprepblabuseabavgsum1_2=p_anyipvblsum1[1...,2]
mat p_sprepblabuseabavgsum1=p_sprepblabuseabavgsum1_1\p_sprepblabuseabavgsum1_2
mat p_blabuseabavgsum1_1=p_anyipvblsum1[1...,3]
mat p_blabuseabavgsum1_2=p_anyipvblsum1[1...,4]
mat p_blabuseabavgsum1=p_blabuseabavgsum1_1\p_blabuseabavgsum1_2

mat p_anyipvbldiff2=p_anyipvbldiff2_1\p_anyipvbldiff2_2
mat p_sprepblabuseabavgdiff2_1=p_anyipvbldiff2[1...,1]
mat p_sprepblabuseabavgdiff2_2=p_anyipvbldiff2[1...,2]
mat p_sprepblabuseabavgdiff2=p_sprepblabuseabavgdiff2_1\p_sprepblabuseabavgdiff2_2
mat p_blabuseabavgdiff2_1=p_anyipvbldiff2[1...,3]
mat p_blabuseabavgdiff2_2=p_anyipvbldiff2[1...,4]
mat p_blabuseabavgdiff2=p_blabuseabavgdiff2_1\p_blabuseabavgdiff2_2


mat p_anyipvbldiff0=p_anyipvbldiff0_1\p_anyipvbldiff0_2
mat p_sprepblabuseabavgdiff0_1=p_anyipvbldiff0[1...,1]
mat p_sprepblabuseabavgdiff0_2=p_anyipvbldiff0[1...,2]
mat p_sprepblabuseabavgdiff0=p_sprepblabuseabavgdiff0_1\p_sprepblabuseabavgdiff0_2
mat p_blabuseabavgdiff0_1=p_anyipvbldiff0[1...,3]
mat p_blabuseabavgdiff0_2=p_anyipvbldiff0[1...,4]
mat p_blabuseabavgdiff0=p_blabuseabavgdiff0_1\p_blabuseabavgdiff0_2

mat p_ttsum=p_ttsum_1\p_ttsum_2
mat p_ttsprepblabuseabavgsum_1=p_ttsum[1...,1]
mat p_ttsprepblabuseabavgsum_2=p_ttsum[1...,2]
mat p_ttsprepblabuseabavgsum=p_ttsprepblabuseabavgsum_1\p_ttsprepblabuseabavgsum_2
mat p_ttblabuseabavgsum_1=p_ttsum[1...,3]
mat p_ttblabuseabavgsum_2=p_ttsum[1...,4]
mat p_ttblabuseabavgsum=p_ttblabuseabavgsum_1\p_ttblabuseabavgsum_2

mat p_tcsum=p_tcsum_1\p_tcsum_2
mat p_tcsprepblabuseabavgsum_1=p_tcsum[1...,1]
mat p_tcsprepblabuseabavgsum_2=p_tcsum[1...,2]
mat p_tcsprepblabuseabavgsum=p_tcsprepblabuseabavgsum_1\p_tcsprepblabuseabavgsum_2
mat p_tcblabuseabavgsum_1=p_tcsum[1...,3]
mat p_tcblabuseabavgsum_2=p_tcsum[1...,4]
mat p_tcblabuseabavgsum=p_tcblabuseabavgsum_1\p_tcblabuseabavgsum_2


mat p_ctsum=p_ctsum_1\p_ctsum_2
mat p_ctsprepblabuseabavgsum_1=p_ctsum[1...,1]
mat p_ctsprepblabuseabavgsum_2=p_ctsum[1...,2]
mat p_ctsprepblabuseabavgsum=p_ctsprepblabuseabavgsum_1\p_ctsprepblabuseabavgsum_2
mat p_ctblabuseabavgsum_1=p_ctsum[1...,3]
mat p_ctblabuseabavgsum_2=p_ctsum[1...,4]
mat p_ctblabuseabavgsum=p_ctblabuseabavgsum_1\p_ctblabuseabavgsum_2

mat p_ttdiff=p_ttdiff_1\p_ttdiff_2
mat p_ttsprepblabuseabavgdiff_1=p_ttdiff[1...,1]
mat p_ttsprepblabuseabavgdiff_2=p_ttdiff[1...,2]
mat p_ttsprepblabuseabavgdiff=p_ttsprepblabuseabavgdiff_1\p_ttsprepblabuseabavgdiff_2
mat p_ttblabuseabavgdiff_1=p_ttdiff[1...,3]
mat p_ttblabuseabavgdiff_2=p_ttdiff[1...,4]
mat p_ttblabuseabavgdiff=p_ttblabuseabavgdiff_1\p_ttblabuseabavgdiff_2

mat p_tcdiff=p_tcdiff_1\p_tcdiff_2
mat p_tcsprepblabuseabavgdiff_1=p_tcdiff[1...,1]
mat p_tcsprepblabuseabavgdiff_2=p_tcdiff[1...,2]
mat p_tcsprepblabuseabavgdiff=p_tcsprepblabuseabavgdiff_1\p_tcsprepblabuseabavgdiff_2
mat p_tcblabuseabavgdiff_1=p_tcdiff[1...,3]
mat p_tcblabuseabavgdiff_2=p_tcdiff[1...,4]
mat p_tcblabuseabavgdiff=p_tcblabuseabavgdiff_1\p_tcblabuseabavgdiff_2

mat p_ctdiff=p_ctdiff_1\p_ctdiff_2
mat p_ctsprepblabuseabavgdiff_1=p_ctdiff[1...,1]
mat p_ctsprepblabuseabavgdiff_2=p_ctdiff[1...,2]
mat p_ctsprepblabuseabavgdiff=p_ctsprepblabuseabavgdiff_1\p_ctsprepblabuseabavgdiff_2
mat p_ctblabuseabavgdiff_1=p_ctdiff[1...,3]
mat p_ctblabuseabavgdiff_2=p_ctdiff[1...,4]
mat p_ctblabuseabavgdiff=p_ctblabuseabavgdiff_1\p_ctblabuseabavgdiff_2


mat tot1=AB1_1\AG1_1
frmttable using "AB1.tex" , rtitle("Domestic violence" \" $ \quad\quad ipv^+=0 $" \ "$ \quad\quad ipv^+=1 $" \"$ \quad\quad ipv^+=2 $ " \"Counseling sessions"\ "$ \quad\quad ipv^+=0 $" \ "$ \quad\quad ipv^+=1 $" \"$ \quad\quad ipv^+=2 $ "\"Received gift" \ "$ \quad\quad ipv^+=0 $" \ "$ \quad\quad ipv^+=1 $" \"$ \quad\quad ipv^+=2 $ "\ "Gave gift"\ "$ \quad\quad ipv^+=0 $" \ "$ \quad\quad ipv^+=1 $" \"$ \quad\quad ipv^+=2 $ " \"Attend any organization" \ "$ \quad\quad ipv^+=0 $" \ "$ \quad\quad ipv^+=1 $" \"$ \quad\quad ipv^+=2 $ "\ "Speak daily"\ "$ \quad\quad ipv^+=0 $" \ "$ \quad\quad ipv^+=1 $" \"$ \quad\quad ipv^+=2 $ ")  statmat(tot1) sdec(3) ctitle("","Control-Control=1","Control-Treat=1","Treat-Control=1","Treat-Treat=1") nocenter varlabels tex frag replace

mat tot4=AC1_1\AF1_1

frmttable using "AC1.tex" , statmat(tot4) sdec(3) ctitle("","Control-Control=1","Control-Treat=1","Treat-Control=1","Treat-Treat=1") rtitle("Domestic violence" \" $ \quad\quad ipv^-=0 $" \ "$ \quad\quad ipv^-=1 $" \"$ \quad\quad ipv^-=2 $ " \"counseling sessions"\ "$ \quad\quad ipv^-=0 $" \ "$ \quad\quad ipv^-=1 $" \"$ \quad\quad ipv^-=2 $ "\"Received gift" \ "$ \quad\quad ipv^-=0 $" \ "$ \quad\quad ipv^-=1 $" \"$ \quad\quad ipv^-=2 $ "\ "Gave gift"\ "$ \quad\quad ipv^-=0 $" \ "$ \quad\quad ipv^-=1 $" \"$ \quad\quad ipv^-=2 $ "\"Attend any organization" \ "$ \quad\quad ipv^-=0 $" \ "$ \quad\quad ipv^-=1 $" \"$ \quad\quad ipv^-=2 $ "\ "Speak daily"\ "$ \quad\quad ipv^-=0 $" \ "$ \quad\quad ipv^-=1 $" \"$ \quad\quad ipv^-=2 $ ") nocenter varlabels tex frag replace




**# Sharpened q-values

preserve
clear

global matricies1 p_ttsprepblabuseabavgsum2 p_tcsprepblabuseabavgsum2 p_ctsprepblabuseabavgsum2 p_ttsprepblabuseabavgsum1 p_tcsprepblabuseabavgsum1 p_ctsprepblabuseabavgsum1 p_ttsprepblabuseabavgdiff2 p_tcsprepblabuseabavgdiff2 p_ctsprepblabuseabavgdiff2 p_ttsprepblabuseabavgdiff0 p_tcsprepblabuseabavgdiff0 p_ctsprepblabuseabavgdiff0 p_sprepblabuseabavgsum2 p_sprepblabuseabavgsum1 p_sprepblabuseabavgdiff2 p_sprepblabuseabavgdiff0 p_ttsprepblabuseabavgsum p_tcsprepblabuseabavgsum p_ctsprepblabuseabavgsum p_ttsprepblabuseabavgdiff p_tcsprepblabuseabavgdiff p_ctsprepblabuseabavgdiff p_treattreat p_treatcontrol p_controltreat p_distancekm p_distancekm2 p_familyext

*The following is adapted from Michael Anderson's code for calculated sharpened q-values (available at https://anderson.are.berkeley.edu/Research.html):
foreach mat of global matricies1{
clear
svmat `mat'
rename `mat' pval

quietly sum pval
local totalpvals = r(N)

* Sort the p-values in ascending order and generate a variable that codes each p-value's rank

quietly gen int original_sorting_order = _n
quietly sort pval
quietly gen int rank = _n if pval~=.

* Set the initial counter to 1 

local qval = 1

* Generate the variable that will contain the BKY (2006) sharpened q-values

gen bky06_qval = 1 if pval~=.

* Set up a loop that begins by checking which hypotheses are rejected at q = 1.000, then checks which hypotheses are rejected at q = 0.999, then checks which hypotheses are rejected at q = 0.998, etc.  The loop ends by checking which hypotheses are rejected at q = 0.001.


while `qval' > 0 {
	* First Stage
	* Generate the adjusted first stage q level we are testing: q' = q/1+q
	local qval_adj = `qval'/(1+`qval')
	* Generate value q'*r/M
	gen fdr_temp1 = `qval_adj'*rank/`totalpvals'
	* Generate binary variable checking condition p(r) <= q'*r/M
	gen reject_temp1 = (fdr_temp1>=pval) if pval~=.
	* Generate variable containing p-value ranks for all p-values that meet above condition
	gen reject_rank1 = reject_temp1*rank
	* Record the rank of the largest p-value that meets above condition
	egen total_rejected1 = max(reject_rank1)

	* Second Stage
	* Generate the second stage q level that accounts for hypotheses rejected in first stage: q_2st = q'*(M/m0)
	local qval_2st = `qval_adj'*(`totalpvals'/(`totalpvals'-total_rejected1[1]))
	* Generate value q_2st*r/M
	gen fdr_temp2 = `qval_2st'*rank/`totalpvals'
	* Generate binary variable checking condition p(r) <= q_2st*r/M
	gen reject_temp2 = (fdr_temp2>=pval) if pval~=.
	* Generate variable containing p-value ranks for all p-values that meet above condition
	gen reject_rank2 = reject_temp2*rank
	* Record the rank of the largest p-value that meets above condition
	egen total_rejected2 = max(reject_rank2)

	* A p-value has been rejected at level q if its rank is less than or equal to the rank of the max p-value that meets the above condition
	replace bky06_qval = `qval' if rank <= total_rejected2 & rank~=.
	* Reduce q by 0.001 and repeat loop
	drop fdr_temp* reject_temp* reject_rank* total_rejected*
	local qval = `qval' - .001
}
	

quietly sort original_sorting_order
pause off
set more off
rename bky06_qval qval
mkmat qval, mat(`mat'sharp)
}

restore




global startvar domvioindv22 giselleprogramindividual22 receivedmoney22 givenmoney22 attendorgtogether22 speakdaily22 
local t=1
foreach var of varlist $startvar{
mat qval= p_treattreatsharp[`t',1],  p_treatcontrolsharp[`t',1], p_controltreatsharp[`t',1], p_distancekmsharp[`t',1], p_distancekm2sharp[`t',1], p_familyextsharp[`t',1]
mat colnames qval = "1.treattreat" "1.treatcontrol" "1.controltreat" "distancekm" "distancekm2"	"familyext"


eststo a`t': reghdfe `var' i.treattreat i.treatcontrol i.controltreat distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch) 

estadd local gender "Women"
estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
estadd mat qval

local ++t
}



esttab a1 a2 a3 a4 a5 a6 using "net22domesticsharp.tex", label replace obslast star(* 0.10 ** 0.05 *** 0.01) se nomtitles mgroups("Domestic Violence" "Counseling Program" "Received Money" "Given Money" "Attend Org" "Speak Daily", pattern(1 1 1 1 1 1) prefix(\multicolumn{@span}{c}{) suffix(}) span ) collabels(none) substitute(\_ _) ///
 interaction(" $\times$ ") b(2) sfmt(2) cells(b(fmt(2) star pvalue(qval)) se(fmt(2) par) qval(fmt(2) par([ ]))) scalars("ccmean Control-Control mean" "fes Village/Enumerator FEs" "regressors Additional symmetric regressors$ \ddagger $") nonotes nogaps noomitted keep(1.treattreat 1.treatcontrol 1.controltreat distancekm distancekm2 familyext _cons)

 



global startvar domvioindv22 giselleprogramindividual22 receivedmoney22 givenmoney22 attendorgtogether22 speakdaily22
global ipvvar sprepblabuseabavg   
local z=1
foreach ipvvar of global ipvvar{
	local t=1
	local v=1
	local s=7
foreach var of varlist $startvar{
	
mat qval= p_`ipvvar'sum2sharp[`t',1],  p_`ipvvar'sum1sharp[`t',1], p_tt`ipvvar'sumsharp[`t',1], p_tc`ipvvar'sumsharp[`t',1], p_ct`ipvvar'sumsharp[`t',1]
mat colnames qval = "2.`ipvvar'sum" "1.`ipvvar'sum" "1.treattreat" "1.treatcontrol" "1.controltreat"	

eststo b`z': reghdfe `var' i.treattreat i.treatcontrol i.controltreat i.`ipvvar'sum  distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch) 
estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1&`ipvvar'sum==0
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
estadd mat qval

local ++z

mat qval=p_tt`ipvvar'sum2sharp[`v',1], p_tc`ipvvar'sum2sharp[`v',1], p_ct`ipvvar'sum2sharp[`v',1],p_tt`ipvvar'sum1sharp[`v',1], p_tc`ipvvar'sum1sharp[`v',1], p_ct`ipvvar'sum1sharp[`v',1], p_`ipvvar'sum2sharp[`s',1],  p_`ipvvar'sum1sharp[`s',1], p_tt`ipvvar'sumsharp[`s',1], p_tc`ipvvar'sumsharp[`s',1], p_ct`ipvvar'sumsharp[`s',1]
mat colnames qval = "1.treattreat#2.`ipvvar'sum" "1.treatcontrol#2.`ipvvar'sum" "1.controltreat#2.`ipvvar'sum" "1.treattreat#1.`ipvvar'sum" "1.treatcontrol#1.`ipvvar'sum" "1.controltreat#1.`ipvvar'sum" "2.`ipvvar'sum" "1.`ipvvar'sum" "1.treattreat" "1.treatcontrol" "1.controltreat"	

eststo b`z': reghdfe `var' i.treattreat i.treattreat#i.`ipvvar'sum i.treatcontrol i.treatcontrol#i.`ipvvar'sum i.controltreat i.controltreat#i.`ipvvar'sum i.`ipvvar'sum  distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch) 
estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1&`ipvvar'sum==0
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
estadd mat qval

local ++t
local ++z
local ++v
local ++s
}
}

 
esttab b1 b2 b3 b4 b5 b6 b7 b8 using "net22domesticviolenceabuseabavgsumsharp.tex", label replace obslast star(* 0.10 ** 0.05 *** 0.01) se nomtitles mgroups("Domestic Violence" "Counseling Program" "Received Money" "Gave Money", pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span ) collabels(none) substitute(\_ _) ///
 interaction(" $\times$ ") b(2) sfmt(2) cells(b(fmt(2) star pvalue(qval)) se(fmt(2) par) qval(fmt(2) par([ ]))) nonotes nogaps  noomitted scalars("ccmean Base mean" "fes Village/Enumerator FEs" "regressors Additional symmetric regressors$ \ddagger $") order(1.treattreat#2.sprepblabuseabavgsum 1.treattreat#1.sprepblabuseabavgsum 1.treatcontrol#2.sprepblabuseabavgsum 1.treatcontrol#1.sprepblabuseabavgsum 1.controltreat#2.sprepblabuseabavgsum 1.controltreat#1.sprepblabuseabavgsum  2.sprepblabuseabavgsum 1.sprepblabuseabavgsum  1.treattreat 1.treatcontrol 1.controltreat distancekm distancekm2 familyext ) keep(1.treattreat#2.sprepblabuseabavgsum 1.treattreat#1.sprepblabuseabavgsum 1.treatcontrol#2.sprepblabuseabavgsum 1.treatcontrol#1.sprepblabuseabavgsum 1.controltreat#2.sprepblabuseabavgsum 1.controltreat#1.sprepblabuseabavgsum  2.sprepblabuseabavgsum 1.sprepblabuseabavgsum  1.treattreat 1.treatcontrol 1.controltreat _cons)
 
esttab b9 b10 b11 b12 using "net22abuseabavgsumsharp.tex", label replace obslast star(* 0.10 ** 0.05 *** 0.01) se nomtitles mgroups("Attend any org" "Speak daily", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span ) collabels(none) substitute(\_ _) ///
 interaction(" $\times$ ") b(2) sfmt(2) cells(b(fmt(2) star pvalue(qval)) se(fmt(2) par) qval(fmt(2) par([ ]))) nonotes nogaps  noomitted scalars("ccmean Base mean" "fes Village/Enumerator FEs" "regressors Additional symmetric regressors$ \ddagger $") order(1.treattreat#2.sprepblabuseabavgsum 1.treattreat#1.sprepblabuseabavgsum 1.treatcontrol#2.sprepblabuseabavgsum 1.treatcontrol#1.sprepblabuseabavgsum 1.controltreat#2.sprepblabuseabavgsum 1.controltreat#1.sprepblabuseabavgsum  2.sprepblabuseabavgsum 1.sprepblabuseabavgsum  1.treattreat 1.treatcontrol 1.controltreat distancekm distancekm2 familyext ) keep(1.treattreat#2.sprepblabuseabavgsum 1.treattreat#1.sprepblabuseabavgsum 1.treatcontrol#2.sprepblabuseabavgsum 1.treatcontrol#1.sprepblabuseabavgsum 1.controltreat#2.sprepblabuseabavgsum 1.controltreat#1.sprepblabuseabavgsum  2.sprepblabuseabavgsum 1.sprepblabuseabavgsum  1.treattreat 1.treatcontrol 1.controltreat _cons)
 
 
 
global startvar domvioindv22 giselleprogramindividual22 receivedmoney22 givenmoney22 attendorgtogether22 speakdaily22
global ipvvar sprepblabuseabavg 
local z=1

foreach ipvvar of global ipvvar{
	local t=1
	local v=1
	local s=7
foreach var of varlist $startvar{
	
mat qval= p_`ipvvar'diff2sharp[`t',1],  p_`ipvvar'diff0sharp[`t',1], p_tt`ipvvar'diffsharp[`t',1], p_tc`ipvvar'diffsharp[`t',1], p_ct`ipvvar'diffsharp[`t',1]
mat colnames qval = "2.`ipvvar'diff" "0.`ipvvar'diff" "1.treattreat" "1.treatcontrol" "1.controltreat"	


eststo b`z': reghdfe `var' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar'diff  distancekm distancekm2 familyext $diffvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch) 
estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1&`ipvvar'diff==0
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
estadd mat qval

local ++z

mat qval=p_tt`ipvvar'diff2sharp[`v',1], p_tc`ipvvar'diff2sharp[`v',1], p_ct`ipvvar'diff2sharp[`v',1],p_tt`ipvvar'diff0sharp[`v',1], p_tc`ipvvar'diff0sharp[`v',1], p_ct`ipvvar'diff0sharp[`v',1], p_`ipvvar'diff2sharp[`s',1],  p_`ipvvar'diff0sharp[`s',1], p_tt`ipvvar'diffsharp[`s',1], p_tc`ipvvar'diffsharp[`s',1], p_ct`ipvvar'diffsharp[`s',1]
mat colnames qval = "1.treattreat#2.`ipvvar'diff" "1.treatcontrol#2.`ipvvar'diff" "1.controltreat#2.`ipvvar'diff" "1.treattreat#0.`ipvvar'diff" "1.treatcontrol#0.`ipvvar'diff" "1.controltreat#0.`ipvvar'diff" "2.`ipvvar'diff" "0.`ipvvar'diff" "1.treattreat" "1.treatcontrol" "1.controltreat"	

eststo b`z': reghdfe `var' i.treattreat i.treattreat#ib1.`ipvvar'diff i.treatcontrol i.treatcontrol#ib1.`ipvvar'diff i.controltreat i.controltreat#ib1.`ipvvar'diff ib1.`ipvvar'diff  distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch) 
estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1&`ipvvar'diff==0
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
estadd mat qval

local ++t
local ++z
local ++v
local ++s
}
}



esttab b1 b2 b3 b4 b5 b6 b7 b8 using "net22domesticviolenceabuseabavgdiffsharp.tex", label replace obslast star(* 0.10 ** 0.05 *** 0.01) se nomtitles mgroups("Domestic Violence" "Counseling Program" "Received Money" "Gave Money", pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span ) collabels(none) substitute(\_ _) ///
 interaction(" $\times$ ") b(2) sfmt(2) cells(b(fmt(2) star pvalue(qval)) se(fmt(2) par) qval(fmt(2) par([ ]))) nonotes nogaps  noomitted scalars("ccmean Base mean" "fes Village/Enumerator FEs" "regressors Additional symmetric regressors$ \ddagger $") order(1.treattreat#2.sprepblabuseabavgdiff 1.treattreat#0.sprepblabuseabavgdiff 1.treatcontrol#2.sprepblabuseabavgdiff 1.treatcontrol#0.sprepblabuseabavgdiff 1.controltreat#2.sprepblabuseabavgdiff 1.controltreat#0.sprepblabuseabavgdiff  2.sprepblabuseabavgdiff 0.sprepblabuseabavgdiff  1.treattreat 1.treatcontrol 1.controltreat distancekm distancekm2 familyext ) keep(1.treattreat#2.sprepblabuseabavgdiff 1.treattreat#0.sprepblabuseabavgdiff 1.treatcontrol#2.sprepblabuseabavgdiff 1.treatcontrol#0.sprepblabuseabavgdiff 1.controltreat#2.sprepblabuseabavgdiff 1.controltreat#0.sprepblabuseabavgdiff  2.sprepblabuseabavgdiff 0.sprepblabuseabavgdiff  1.treattreat 1.treatcontrol 1.controltreat _cons)
 
esttab b9 b10 b11 b12 using "net22abuseabavgdiffsharp.tex", label replace obslast star(* 0.10 ** 0.05 *** 0.01) se nomtitles mgroups("Attend any org" "Speak daily", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span ) collabels(none) substitute(\_ _) ///
 interaction(" $\times$ ") b(2) sfmt(2) cells(b(fmt(2) star pvalue(qval)) se(fmt(2) par) qval(fmt(2) par([ ]))) nonotes nogaps  noomitted scalars("ccmean Base mean" "fes Village/Enumerator FEs" "regressors Additional symmetric regressors$ \ddagger $") order(1.treattreat#2.sprepblabuseabavgdiff 1.treattreat#0.sprepblabuseabavgdiff 1.treatcontrol#2.sprepblabuseabavgdiff 1.treatcontrol#0.sprepblabuseabavgdiff 1.controltreat#2.sprepblabuseabavgdiff 1.controltreat#0.sprepblabuseabavgdiff  2.sprepblabuseabavgdiff 0.sprepblabuseabavgdiff  1.treattreat 1.treatcontrol 1.controltreat distancekm distancekm2 familyext ) keep(1.treattreat#2.sprepblabuseabavgdiff 1.treattreat#0.sprepblabuseabavgdiff 1.treatcontrol#2.sprepblabuseabavgdiff 1.treatcontrol#0.sprepblabuseabavgdiff 1.controltreat#2.sprepblabuseabavgdiff 1.controltreat#0.sprepblabuseabavgdiff  2.sprepblabuseabavgdiff 0.sprepblabuseabavgdiff  1.treattreat 1.treatcontrol 1.controltreat _cons)
 
 


global blalcoholnumbersum blalcoholnumbersum
global blalcoholnumberdiff blalcoholnumberdiff
sort hhid indvid



global sumvars2 : list global(sumvars1) - global(blalcoholnumbersum)
global diffvars2 : list global(diffvars1) - global(blalcoholnumberdiff)

gen anyblalcohol=(blalcoholnumber>0)
gen anyblalcoholmch=(blalcoholnumbermch>0)
gen anyspblalcohol=(spblalcoholnumber>0)
gen anyspblalcoholmch=(spblalcoholnumbermch>0)


gen anyblalcoholsum=anyblalcohol+anyblalcoholmch
gen anyblalcoholdiff=anyblalcohol-anyblalcoholmch

gen anyspblalcoholsum=anyspblalcohol+anyspblalcoholmch
gen anyspblalcoholdiff=anyspblalcohol-anyspblalcoholmch

recode anyblalcoholdiff (1=2) (0=1) (-1=0)
recode anyspblalcoholdiff (1=2) (0=1) (-1=0)

label var anyblalcoholsum "Any baseline alcohol$ ^+_{ij} $"
label var anyblalcoholdiff "Any baseline alcohol$ ^-_{ij} $"
label var anyspblalcoholsum "Any spouse baseline alcohol$ ^+_{ij} $"
label var anyspblalcoholdiff "Any spouse baseline alcohol$ ^-_{ij} $"




////sp alcohol

eststo clear

global outcomevar domvioindv22 giselleprogramindividual22 receivedmoney22 givenmoney22
local y=1

foreach var of varlist $outcomevar{
	

eststo k`y': reghdfe `var' i.treattreat#i.anyspblalcoholsum i.treatcontrol#i.anyspblalcoholsum i.controltreat#i.anyspblalcoholsum i.treattreat i.treatcontrol i.controltreat i.anyspblalcoholsum distancekm distancekm2 familyext, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "No"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++y

eststo k`y': reghdfe `var' i.treattreat#i.anyspblalcoholsum i.treatcontrol#i.anyspblalcoholsum i.controltreat#i.anyspblalcoholsum i.treattreat i.treatcontrol i.controltreat i.anyspblalcoholsum distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean

local ++y
}
esttab k1 k2 k3 k4 k5 k6 k7 k8 using "net22spdomesticalcsum.tex", label replace obslast star(* 0.10 ** 0.05 *** 0.01) se nomtitles mgroups("Domestic Violence" "Counseling Program" "Received Money" "Given Money", pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span ) substitute(\_ _) ///
 interaction(" $\times$ ")  scalars("ccmean Base mean" "fes Village/Enumerator FEs" "regressors Additional symmetric regressors") b(2) sfmt(2) nonotes nogaps  noomitted order(1.treattreat#2.anyspblalcoholsum 1.treattreat#1.anyspblalcoholsum 1.treatcontrol#2.anyspblalcoholsum 1.treatcontrol#1.anyspblalcoholsum 1.controltreat#2.anyspblalcoholsum 1.controltreat#1.anyspblalcoholsum  2.anyspblalcoholsum 1.anyspblalcoholsum  1.treattreat 1.treatcontrol 1.controltreat distancekm distancekm2 familyext ) keep(1.treattreat#2.anyspblalcoholsum 1.treattreat#1.anyspblalcoholsum 1.treatcontrol#2.anyspblalcoholsum 1.treatcontrol#1.anyspblalcoholsum 1.controltreat#2.anyspblalcoholsum 1.controltreat#1.anyspblalcoholsum  2.anyspblalcoholsum 1.anyspblalcoholsum  1.treattreat 1.treatcontrol 1.controltreat distancekm distancekm2 familyext _cons)
 




local y=1


foreach var of varlist $outcomevar{
	

eststo l`y': reghdfe `var' i.treattreat#ib1.anyspblalcoholdiff i.treatcontrol#ib1.anyspblalcoholdiff i.controltreat#ib1.anyspblalcoholdiff i.treattreat i.treatcontrol i.controltreat ib1.anyspblalcoholdiff distancekm distancekm2 familyext, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "No"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++y

eststo l`y': reghdfe `var' i.treattreat#ib1.anyspblalcoholdiff i.treatcontrol#ib1.anyspblalcoholdiff i.controltreat#ib1.anyspblalcoholdiff i.treattreat i.treatcontrol i.controltreat ib1.anyspblalcoholdiff distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean

local ++y
}
esttab l1 l2 l3 l4 l5 l6 l7 l8 using "net22spdomesticalcdiff.tex", label replace obslast star(* 0.10 ** 0.05 *** 0.01) se nomtitles mgroups("Domestic Violence" "Counseling Program" "Received Money" "Given Money", pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span ) substitute(\_ _) ///
 interaction(" $\times$ ")  scalars("ccmean Base mean" "fes Village/Enumerator FEs" "regressors Additional symmetric regressors$ \ddagger $") b(2) sfmt(2) nonotes nogaps  noomitted order(1.treattreat#2.anyspblalcoholdiff 1.treattreat#0.anyspblalcoholdiff 1.treatcontrol#2.anyspblalcoholdiff 1.treatcontrol#0.anyspblalcoholdiff 1.controltreat#2.anyspblalcoholdiff 1.controltreat#0.anyspblalcoholdiff  2.anyspblalcoholdiff 0.anyspblalcoholdiff  1.treattreat 1.treatcontrol 1.controltreat distancekm distancekm2 familyext ) keep(1.treattreat#2.anyspblalcoholdiff 1.treattreat#0.anyspblalcoholdiff 1.treatcontrol#2.anyspblalcoholdiff 1.treatcontrol#0.anyspblalcoholdiff 1.controltreat#2.anyspblalcoholdiff 1.controltreat#0.anyspblalcoholdiff  2.anyspblalcoholdiff 0.anyspblalcoholdiff  1.treattreat 1.treatcontrol 1.controltreat distancekm distancekm2 familyext _cons)
 










global outcomevar attendorgtogether22 speakdaily22
local y=1

foreach var of varlist $outcomevar{
	

eststo m`y': reghdfe `var' i.treattreat#i.anyspblalcoholsum i.treatcontrol#i.anyspblalcoholsum i.controltreat#i.anyspblalcoholsum i.treattreat i.treatcontrol i.controltreat i.anyspblalcoholsum distancekm distancekm2 familyext, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "No"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++y

eststo m`y': reghdfe `var' i.treattreat#i.anyspblalcoholsum i.treatcontrol#i.anyspblalcoholsum i.controltreat#i.anyspblalcoholsum i.treattreat i.treatcontrol i.controltreat i.anyspblalcoholsum distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean

local ++y
}





local y=1


foreach var of varlist $outcomevar{
	

eststo n`y': reghdfe `var' i.treattreat#ib1.anyspblalcoholdiff i.treatcontrol#ib1.anyspblalcoholdiff i.controltreat#ib1.anyspblalcoholdiff i.treattreat i.treatcontrol i.controltreat ib1.anyspblalcoholdiff distancekm distancekm2 familyext, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "No"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++y

eststo n`y': reghdfe `var' i.treattreat#ib1.anyspblalcoholdiff i.treatcontrol#ib1.anyspblalcoholdiff i.controltreat#ib1.anyspblalcoholdiff i.treattreat i.treatcontrol i.controltreat ib1.anyspblalcoholdiff distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean

local ++y
}




coefplot  (k2, mcolor(black) ciopts(lcolor(black) lwidth(thin)) msize(small) label("Disc. domestic violence")) (k4, mcolor(black) ciopts(lcolor(black)) msize(small) msymbol(T) label("Disc. counseling program")) (k6, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(small) label("Received money")) (k8 , msymbol(S) mcolor(black) ciopts(lcolor(black)) msize(small) label("Gave money")) (m2 , mcolor(black) ciopts(lcolor(black)) msize(small) msymbol(Oh) label("Attend any org")) (m4, mcolor(black) ciopts(lcolor(black)) msize(small) msymbol(Th) label("Speak daily")), label keep(1.treattreat#1.anyspblalcoholsum 1.treatcontrol#1.anyspblalcoholsum 1.controltreat#1.anyspblalcoholsum) rename(1.treattreat#2.anyspblalcoholsum="Treat-Treat X Sum Sp Alc=2" 1.treattreat#1.anyspblalcoholsum="Treat-Treat X Sum Sp Alc=1" 1.treatcontrol#2.anyspblalcoholsum="Treat-Control X Sum Sp Alc=2" 1.treatcontrol#1.anyspblalcoholsum="Treat-Control X Sum Sp Alc=1" 1.controltreat#2.anyspblalcoholsum="Control-Treat X Sum Sp Alc=2" 1.controltreat#1.anyspblalcoholsum="Control-Treat X Sum Sp Alc=1") xline(0, lstyle(color(black) pattern(dash)))  ysize(3) xsize(3) scale(.65) legend(size(small))  ylabel(,labsize(small))
graph export spalcsum1.jpg, replace  width(4000) height(4800) quality(75)


coefplot  (k2, mcolor(black) ciopts(lcolor(black) lwidth(thin)) msize(small) label("Disc. domestic violence")) (k4, mcolor(black) ciopts(lcolor(black)) msize(small) msymbol(T) label("Disc. counseling program")) (k6, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(small) label("Received money")) (k8 , msymbol(S) mcolor(black) ciopts(lcolor(black)) msize(small) label("Gave money")) (m2 , mcolor(black) ciopts(lcolor(black)) msize(small) msymbol(Oh) label("Attend any org")) (m4, mcolor(black) ciopts(lcolor(black)) msize(small) msymbol(Th) label("Speak daily")), label  keep(1.treattreat#2.anyspblalcoholsum 1.treatcontrol#2.anyspblalcoholsum 1.controltreat#2.anyspblalcoholsum) rename(1.treattreat#2.anyspblalcoholsum="Treat-Treat X Sum Sp Alc=2" 1.treattreat#2.anyspblalcoholsum="Treat-Treat X Sum Sp Alc=2" 1.treatcontrol#2.anyspblalcoholsum="Treat-Control X Sum Sp Alc=2" 1.treatcontrol#2.anyspblalcoholsum="Treat-Control X Sum Sp Alc=2" 1.controltreat#2.anyspblalcoholsum="Control-Treat X Sum Sp Alc=2" 1.controltreat#2.anyspblalcoholsum="Control-Treat X Sum Sp Alc=2") xline(0, lstyle(color(black) pattern(dash)))  ysize(3) xsize(3) scale(.65) legend(size(small))  ylabel(,labsize(small))

graph export spalcsum2.jpg, replace  width(4000) height(4800) quality(75)



coefplot (l2, mcolor(black) ciopts(lcolor(black) lwidth(thin)) msize(small) label("Disc. domestic violence")) (l4, mcolor(black) ciopts(lcolor(black)) msize(small) msymbol(T) label("Disc. counseling program")) (l6, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(small) label("Received money")) (l8 , msymbol(S) mcolor(black) ciopts(lcolor(black)) msize(small) label("Gave money")) (n2 , mcolor(black) ciopts(lcolor(black)) msize(small) msymbol(Oh) label("Attend any org")) (n4, mcolor(black) ciopts(lcolor(black)) msize(small) msymbol(Th) label("Speak daily")), label keep(1.treattreat#0.anyspblalcoholdiff 1.treatcontrol#0.anyspblalcoholdiff 1.controltreat#0.anyspblalcoholdiff) rename(1.treattreat#2.anyspblalcoholdiff="Treat-Treat X Diff Sp Alc=2" 1.treattreat#0.anyspblalcoholdiff="Treat-Treat X Diff Sp Alc=0" 1.treatcontrol#2.anyspblalcoholdiff="Treat-Control X Diff Sp Alc=2" 1.treatcontrol#0.anyspblalcoholdiff="Treat-Control X Diff Sp Alc=0" 1.controltreat#2.anyspblalcoholdiff="Control-Treat X Diff Sp Alc=2" 1.controltreat#0.anyspblalcoholdiff="Control-Treat X Diff Sp Alc=0") xline(0, lstyle(color(black) pattern(dash)))  ysize(3) xsize(3) scale(.65) legend(size(small))  ylabel(,labsize(small))

graph export spalcdiff1.jpg, replace  width(4000) height(4800) quality(75)


coefplot  (l2, mcolor(black) ciopts(lcolor(black) lwidth(thin)) msize(small) label("Disc. domestic violence")) (l4, mcolor(black) ciopts(lcolor(black)) msize(small) msymbol(T) label("Disc. counseling program")) (l6, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(small) label("Received money")) (l8 , msymbol(S) mcolor(black) ciopts(lcolor(black)) msize(small) label("Gave money")) (n2 , mcolor(black) ciopts(lcolor(black)) msize(small) msymbol(Oh) label("Attend any org")) (n4, mcolor(black) ciopts(lcolor(black)) msize(small) msymbol(Th) label("Speak daily")), label keep(1.treattreat#2.anyspblalcoholdiff 1.treatcontrol#2.anyspblalcoholdiff 1.controltreat#2.anyspblalcoholdiff) rename(1.treattreat#2.anyspblalcoholdiff="Treat-Treat X Diff Sp Alc=2" 1.treattreat#2.anyspblalcoholdiff="Treat-Treat X Diff Sp Alc=0" 1.treatcontrol#2.anyspblalcoholdiff="Treat-Control X Diff Sp Alc=2" 1.treatcontrol#2.anyspblalcoholdiff="Treat-Control X Diff Sp Alc=0" 1.controltreat#2.anyspblalcoholdiff="Control-Treat X Diff Sp Alc=2" 1.controltreat#2.anyspblalcoholdiff="Control-Treat X Diff Sp Alc=0") xline(0, lstyle(color(black) pattern(dash)))  ysize(3) xsize(3) scale(.65) legend(size(small))  ylabel(,labsize(small))

graph export spalcdiff2.jpg, replace  width(4000) height(4800) quality(75)


**# ///attrition manski bounds





global ipvvar sprepblabuseabavgsum   

global outcomevar domvioindv22atrtu giselleprogramindividual22atrtu receivedmoney22atrtu givenmoney22atrtu 
local y=1
foreach ipvvar of varlist $ipvvar{

local z=1

foreach var of varlist $outcomevar{



eststo b`z'_`y': reghdfe `var' i.treattreat#i.`ipvvar' i.treatcontrol#i.`ipvvar'  i.controltreat#i.`ipvvar' i.treattreat i.treatcontrol i.controltreat i.`ipvvar' distancekm distancekm2 familyext, absorb($villagenumber $enumerators) cluster(indvid indvidmch)	
estadd local fes "Yes"
estadd local regressors "No"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++z




eststo b`z'_`y': reghdfe `var' i.treattreat#i.`ipvvar' i.treatcontrol#i.`ipvvar'  i.controltreat#i.`ipvvar' i.treattreat i.treatcontrol i.controltreat i.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)	

estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++z

}


local ++y


}


 
global ipvvar sprepblabuseabavgdiff 

global outcomevar domvioindv22atrtu giselleprogramindividual22atrtu receivedmoney22atrtu givenmoney22atrtu 
local y=1

foreach ipvvar of varlist $ipvvar{

local z=1

foreach var of varlist $outcomevar{

	
eststo c`z'_`y': reghdfe `var' i.treattreat#ib1.`ipvvar' i.treatcontrol#ib1.`ipvvar' i.controltreat#ib1.`ipvvar' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "No"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean

local ++z

eststo c`z'_`y': reghdfe `var' i.treattreat#ib1.`ipvvar' i.treatcontrol#ib1.`ipvvar' i.controltreat#ib1.`ipvvar' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean

local ++z

}

 

 
local ++y

}
 


global ipvvar  sprepblabuseabavgsum

global outcomevar  attendorgtogether22atrtu speakdaily22atrtu
local y=1

foreach ipvvar of varlist $ipvvar{

local z=1

foreach var of varlist $outcomevar{
	
eststo g`z'_`y': reghdfe `var' i.treattreat#i.`ipvvar' i.treatcontrol#i.`ipvvar'  i.controltreat#i.`ipvvar' i.treattreat i.treatcontrol i.controltreat i.`ipvvar' distancekm distancekm2 familyext, absorb($villagenumber $enumerators) cluster(indvid indvidmch)	
estadd local fes "Yes"
estadd local regressors "No"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++z


eststo g`z'_`y': reghdfe `var' i.treattreat#i.`ipvvar' i.treatcontrol#i.`ipvvar'  i.controltreat#i.`ipvvar' i.treattreat i.treatcontrol i.controltreat i.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1 , absorb($villagenumber $enumerators) cluster(indvid indvidmch)	
estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean

local ++z
}

local ++y
}





global ipvvar sprepblabuseabavgdiff

global outcomevar attendorgtogether22atrtu speakdaily22atrtu
local y=1

foreach ipvvar of varlist $ipvvar{

local z=1

foreach var of varlist $outcomevar{
	
eststo f`z'_`y': reghdfe `var' i.treattreat#ib1.`ipvvar' i.treatcontrol#ib1.`ipvvar' i.controltreat#ib1.`ipvvar' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1 , absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "No"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean

local ++z

eststo f`z'_`y': reghdfe `var' i.treattreat#ib1.`ipvvar' i.treatcontrol#ib1.`ipvvar' i.controltreat#ib1.`ipvvar' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1 , absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++z
}

 
local ++y
}


 




coefplot  (b2_1, mcolor(black) ciopts(lcolor(black) ) msize(small) label("Disc. domestic violence")) (b4_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(T) label("Disc. counseling program")) (b6_1, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(small) label("Received money")) (b8_1, msymbol(S) mcolor(black) ciopts(lcolor(black) ) msize(small) label("Gave money")) (g2_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(Oh) label("Attend any org")) (g4_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(Th) label("Speak daily")), label keep(1.treattreat#1.sprepblabuseabavgsum 1.treatcontrol#1.sprepblabuseabavgsum 1.controltreat#1.sprepblabuseabavgsum)  rename(1.treattreat#1.sprepblabuseabavgsum="Treat-Treat X Sum Sp. Beat Abv Avg=1" 1.treatcontrol#1.sprepblabuseabavgsum="Treat-Control X Sum Sp. Beat Abv Avg=1"  1.controltreat#1.sprepblabuseabavgsum="Control-Treat X Sum Sp. Beat Abv Avg=1") xline(0, lstyle(color(black) pattern(dash))) legend(size(small))  ysize(3) xsize(3) scale(.65) ylabel(,labsize(small))
graph export sprepblabuseabavgsum1atrtu.jpg, replace  width(4000) height(4800) quality(75)

coefplot  (b2_1, mcolor(black) ciopts(lcolor(black) ) msize(small) label("Disc. domestic violence")) (b4_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(T) label("Disc. counseling program")) (b6_1, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(small) label("Received money")) (b8_1, msymbol(S) mcolor(black) ciopts(lcolor(black) ) msize(small) label("Gave money")) (g2_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(Oh) label("Attend any org")) (g4_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(Th) label("Speak daily")), label keep(1.treattreat#2.sprepblabuseabavgsum 1.treatcontrol#2.sprepblabuseabavgsum 1.controltreat#2.sprepblabuseabavgsum)  rename(1.treattreat#2.sprepblabuseabavgsum="Treat-Treat X Sum Sp. Beat Abv Avg=2" 1.treatcontrol#2.sprepblabuseabavgsum="Treat-Control X Sum Sp. Beat Abv Avg=2"  1.controltreat#2.sprepblabuseabavgsum="Control-Treat X Sum Sp. Beat Abv Avg=2") xline(0, lstyle(color(black) pattern(dash)))  ysize(3) xsize(3) scale(.65) legend(size(small))  ylabel(,labsize(small))
graph export sprepblabuseabavgsum2atrtu.jpg, replace  width(4000) height(4800) quality(75)


coefplot (c2_1, mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Disc. domestic violence")) (c4_1, mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(T) label("Disc. counseling program")) (c6_1, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Received money")) (c8_1, msymbol(S) mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Gave money")) (f2_1 , mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(Oh) label("Attend any org")) (f4_1 , mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(Th) label("Speak daily")), label keep(1.treattreat#0.sprepblabuseabavgdiff 1.treatcontrol#0.sprepblabuseabavgdiff  1.controltreat#0.sprepblabuseabavgdiff)  rename(1.treattreat#0.sprepblabuseabavgdiff="Treat-Treat X Diff Sp. Beat Abv Avg=0" 1.treatcontrol#0.sprepblabuseabavgdiff="Treat-Control X Diff Sp. Beat Abv Avg=0" 1.controltreat#0.sprepblabuseabavgdiff="Control-Treat X Diff Sp. Beat Abv Avg=0") xline(0, lstyle(color(black) pattern(dash))) ysize(3) xsize(3) scale(.65) legend(size(small))  ylabel(,labsize(small))
graph export sprepblabuseabavgdiff1atrtu.jpg, replace  width(4000) height(4800) quality(75)


coefplot (c2_1, mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Disc. domestic violence")) (c4_1, mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(T) label("Disc. counseling program")) (c6_1, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Received money")) (c8_1, msymbol(S) mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Gave money")) (f2_1 , mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(Oh) label("Attend any org")) (f4_1 , mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(Th) label("Speak daily")), label keep(1.treattreat#2.sprepblabuseabavgdiff 1.treatcontrol#2.sprepblabuseabavgdiff  1.controltreat#2.sprepblabuseabavgdiff)  rename(1.treattreat#2.sprepblabuseabavgdiff="Treat-Treat X Diff Sp. Beat Abv Avg=2" 1.treatcontrol#2.sprepblabuseabavgdiff="Treat-Control X Diff Sp. Beat Abv Avg=2" 1.controltreat#2.sprepblabuseabavgdiff="Control-Treat X Diff Sp. Beat Abv Avg=2") xline(0, lstyle(color(black) pattern(dash))) ysize(3) xsize(3) scale(.65) legend(size(small))  ylabel(,labsize(small))
graph export sprepblabuseabavgdiff2atrtu.jpg, replace  width(4000) height(4800) quality(75)



global ipvvar sprepblabuseabavgsum   

global outcomevar domvioindv22atrtb giselleprogramindividual22atrtb receivedmoney22atrtb givenmoney22atrtb 
local y=1
foreach ipvvar of varlist $ipvvar{

local z=1

foreach var of varlist $outcomevar{



eststo b`z'_`y': reghdfe `var' i.treattreat#i.`ipvvar' i.treatcontrol#i.`ipvvar'  i.controltreat#i.`ipvvar' i.treattreat i.treatcontrol i.controltreat i.`ipvvar' distancekm distancekm2 familyext, absorb($villagenumber $enumerators) cluster(indvid indvidmch)	
estadd local fes "Yes"
estadd local regressors "No"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++z




eststo b`z'_`y': reghdfe `var' i.treattreat#i.`ipvvar' i.treatcontrol#i.`ipvvar'  i.controltreat#i.`ipvvar' i.treattreat i.treatcontrol i.controltreat i.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)	

estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++z

}


local ++y


}

 
global ipvvar sprepblabuseabavgdiff 

global outcomevar domvioindv22atrtb giselleprogramindividual22atrtb receivedmoney22atrtb givenmoney22atrtb 
local y=1

foreach ipvvar of varlist $ipvvar{

local z=1

foreach var of varlist $outcomevar{

	
eststo c`z'_`y': reghdfe `var' i.treattreat#ib1.`ipvvar' i.treatcontrol#ib1.`ipvvar' i.controltreat#ib1.`ipvvar' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "No"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean

local ++z

eststo c`z'_`y': reghdfe `var' i.treattreat#ib1.`ipvvar' i.treatcontrol#ib1.`ipvvar' i.controltreat#ib1.`ipvvar' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1, absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean

local ++z

}

 

 
local ++y

}
 

 

 


global ipvvar sprepblabuseabavgsum

global outcomevar  attendorgtogether22atrtb speakdaily22atrtb
local y=1

foreach ipvvar of varlist $ipvvar{

local z=1

foreach var of varlist $outcomevar{
	
eststo g`z'_`y': reghdfe `var' i.treattreat#i.`ipvvar' i.treatcontrol#i.`ipvvar'  i.controltreat#i.`ipvvar' i.treattreat i.treatcontrol i.controltreat i.`ipvvar' distancekm distancekm2 familyext, absorb($villagenumber $enumerators) cluster(indvid indvidmch)	
estadd local fes "Yes"
estadd local regressors "No"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++z


eststo g`z'_`y': reghdfe `var' i.treattreat#i.`ipvvar' i.treatcontrol#i.`ipvvar'  i.controltreat#i.`ipvvar' i.treattreat i.treatcontrol i.controltreat i.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1 , absorb($villagenumber $enumerators) cluster(indvid indvidmch)	
estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean

local ++z
}

local ++y
}







global ipvvar sprepblabuseabavgdiff

global outcomevar attendorgtogether22atrtb speakdaily22atrtb
local y=1

foreach ipvvar of varlist $ipvvar{

local z=1

foreach var of varlist $outcomevar{
	
eststo f`z'_`y': reghdfe `var' i.treattreat#ib1.`ipvvar' i.treatcontrol#ib1.`ipvvar' i.controltreat#ib1.`ipvvar' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1 , absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "No"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean

local ++z

eststo f`z'_`y': reghdfe `var' i.treattreat#ib1.`ipvvar' i.treatcontrol#ib1.`ipvvar' i.controltreat#ib1.`ipvvar' i.treattreat i.treatcontrol i.controltreat ib1.`ipvvar' distancekm distancekm2 familyext $sumvars1 $diffvars1 , absorb($villagenumber $enumerators) cluster(indvid indvidmch)
estadd local fes "Yes"
estadd local regressors "Yes"
sum `var' if controlcontrol==1
scalar mean= round(r(mean), .01)
estadd scalar ccmean=mean
local ++z
}

 
local ++y
}


 
 






coefplot  (b2_1, mcolor(black) ciopts(lcolor(black) ) msize(small) label("Disc. domestic violence")) (b4_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(T) label("Disc. counseling program")) (b6_1, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(small) label("Received money")) (b8_1, msymbol(S) mcolor(black) ciopts(lcolor(black) ) msize(small) label("Gave money")) (g2_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(Oh) label("Attend any org")) (g4_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(Th) label("Speak daily")), label keep(1.treattreat#1.sprepblabuseabavgsum 1.treatcontrol#1.sprepblabuseabavgsum 1.controltreat#1.sprepblabuseabavgsum)  rename(1.treattreat#1.sprepblabuseabavgsum="Treat-Treat X Sum Sp. Beat Abv Avg=1" 1.treatcontrol#1.sprepblabuseabavgsum="Treat-Control X Sum Sp. Beat Abv Avg=1"  1.controltreat#1.sprepblabuseabavgsum="Control-Treat X Sum Sp. Beat Abv Avg=1") xline(0, lstyle(color(black) pattern(dash))) legend(size(small))  ysize(3) xsize(3) scale(.65) ylabel(,labsize(small))
graph export sprepblabuseabavgsum1atrtb.jpg, replace  width(4000) height(4800) quality(75)

coefplot  (b2_1, mcolor(black) ciopts(lcolor(black) ) msize(small) label("Disc. domestic violence")) (b4_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(T) label("Disc. counseling program")) (b6_1, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(small) label("Received money")) (b8_1, msymbol(S) mcolor(black) ciopts(lcolor(black) ) msize(small) label("Gave money")) (g2_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(Oh) label("Attend any org")) (g4_1, mcolor(black) ciopts(lcolor(black) ) msize(small) msymbol(Th) label("Speak daily")), label keep(1.treattreat#2.sprepblabuseabavgsum 1.treatcontrol#2.sprepblabuseabavgsum 1.controltreat#2.sprepblabuseabavgsum)  rename(1.treattreat#2.sprepblabuseabavgsum="Treat-Treat X Sum Sp. Beat Abv Avg=2" 1.treatcontrol#2.sprepblabuseabavgsum="Treat-Control X Sum Sp. Beat Abv Avg=2"  1.controltreat#2.sprepblabuseabavgsum="Control-Treat X Sum Sp. Beat Abv Avg=2") xline(0, lstyle(color(black) pattern(dash)))  ysize(3) xsize(3) scale(.65) legend(size(small))  ylabel(,labsize(small))
graph export sprepblabuseabavgsum2atrtb.jpg, replace  width(4000) height(4800) quality(75)


coefplot (c2_1, mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Disc. domestic violence")) (c4_1, mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(T) label("Disc. counseling program")) (c6_1, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Received money")) (c8_1, msymbol(S) mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Gave money")) (f2_1 , mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(Oh) label("Attend any org")) (f4_1 , mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(Th) label("Speak daily")), label keep(1.treattreat#0.sprepblabuseabavgdiff 1.treatcontrol#0.sprepblabuseabavgdiff  1.controltreat#0.sprepblabuseabavgdiff)  rename(1.treattreat#0.sprepblabuseabavgdiff="Treat-Treat X Diff Sp. Beat Abv Avg=0" 1.treatcontrol#0.sprepblabuseabavgdiff="Treat-Control X Diff Sp. Beat Abv Avg=0" 1.controltreat#0.sprepblabuseabavgdiff="Control-Treat X Diff Sp. Beat Abv Avg=0") xline(0, lstyle(color(black) pattern(dash))) ysize(3) xsize(3) scale(.65) legend(size(small))  ylabel(,labsize(small))
graph export sprepblabuseabavgdiff1atrtb.jpg, replace  width(4000) height(4800) quality(75)


coefplot (c2_1, mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Disc. domestic violence")) (c4_1, mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(T) label("Disc. counseling program")) (c6_1, msymbol(D)  mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Received money")) (c8_1, msymbol(S) mcolor(black) ciopts(lcolor(black) ) msize(medsmall) label("Gave money")) (f2_1 , mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(Oh) label("Attend any org")) (f4_1 , mcolor(black) ciopts(lcolor(black) ) msize(medsmall) msymbol(Th) label("Speak daily")), label keep(1.treattreat#2.sprepblabuseabavgdiff 1.treatcontrol#2.sprepblabuseabavgdiff  1.controltreat#2.sprepblabuseabavgdiff)  rename(1.treattreat#2.sprepblabuseabavgdiff="Treat-Treat X Diff Sp. Beat Abv Avg=2" 1.treatcontrol#2.sprepblabuseabavgdiff="Treat-Control X Diff Sp. Beat Abv Avg=2" 1.controltreat#2.sprepblabuseabavgdiff="Control-Treat X Diff Sp. Beat Abv Avg=2") xline(0, lstyle(color(black) pattern(dash))) ysize(3) xsize(3) scale(.65) legend(size(small))  ylabel(,labsize(small))
graph export sprepblabuseabavgdiff2atrtb.jpg, replace  width(4000) height(4800) quality(75)

